A
Ali-k
Guest
Hi,
I am having a little problem that is driving me mad . When trying to fill my data-grid noting happens . No error or noting . The only thing i can see is when i run the application a red x is put on my database in the server explorer and when i refresh it it will return to normal.
Any help would be appreciated.
Thanks.
private void btnSearch_Click(object sender, EventArgs e)
{
searchAll();
}
public void searchAll()
{
OleDbConnection conToDataBase = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Resources\health_plus.accdb;Persist Security Info=True");
OleDbCommand searchAllCom = new OleDbCommand("SELECT * FROM Doctors", conToDataBase);
conToDataBase.Open();
searchAllCom.CommandType = CommandType.Text;
OleDbDataAdapter searchDocAdapter = new OleDbDataAdapter(searchAllCom);
DataTable doctorsTable = new DataTable();
searchDocAdapter.Fill(doctorsTable);
searchDoctorDataGrid.DataSource = doctorsTable;
}
Continue reading...
I am having a little problem that is driving me mad . When trying to fill my data-grid noting happens . No error or noting . The only thing i can see is when i run the application a red x is put on my database in the server explorer and when i refresh it it will return to normal.
Any help would be appreciated.
Thanks.
private void btnSearch_Click(object sender, EventArgs e)
{
searchAll();
}
public void searchAll()
{
OleDbConnection conToDataBase = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=|DataDirectory|\Resources\health_plus.accdb;Persist Security Info=True");
OleDbCommand searchAllCom = new OleDbCommand("SELECT * FROM Doctors", conToDataBase);
conToDataBase.Open();
searchAllCom.CommandType = CommandType.Text;
OleDbDataAdapter searchDocAdapter = new OleDbDataAdapter(searchAllCom);
DataTable doctorsTable = new DataTable();
searchDocAdapter.Fill(doctorsTable);
searchDoctorDataGrid.DataSource = doctorsTable;
}
Continue reading...