hi, i'm new to c# programming and i have this problem that i encountered while trying to create a database browser. Here is my code:
private void button1_Click(object sender, EventArgs e)
{
string search;
search = searchbox.Text;
if (search == "")
{
MessageBox.Show("You have not entered anything. Please enter the error code to display the correct error description.");
}
switch(search.Remove(4))
{
case "AH01":
{
OleDbConnection conn = new OleDbConnection(@"provider = Microsoft.Jet.OLEDB.4.0;Data Source= C:\Documents and Settings\Administrator\My Documents\Error Status list Database.mdb");
OleDbCommand ah = new OleDbCommand("SELECT ID, Status FROM AH01", conn);
progress.Value = 40;
conn.Open();
OleDbDataReader dr = ah.ExecuteReader();
while (dr.Read())
{
GridView1.DataSource = dr;
}
dr.Close();
progress.Value = 100;
conn.Close();
break;
}
my problem is that when i debugged it, there was no error but the data that is searched does not display in the datagrid i have created. really need your feed back on this. thanks