Hi want to read data from data base from the given ID (not Premanent). I am using the following code:
OleDbConnection co = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\db1.mdb"); co.Open(); **OleDbCommand cmd = new OleDbCommand("SELECT * FROM Category1 Where ID = '"+textBox1.Text+"'", co);** OleDbDataReader reader = cmd.ExecuteReader(); int i = 1; while (reader.Read()) { ListViewItem li = new ListViewItem(i.ToString()); li.SubItems.Add(reader.GetString(1)); li.SubItems.Add(reader.GetString(2)); li.SubItems.Add(reader.GetString(3)); li.SubItems.Add(reader.GetString(4)); listView1.Items.Add(li); i++; } but it shows me an error message on the Bold line of code:
Data type mismatch in criteria expression.