I have a problem when i want to read data from Access table using this code:-
public void insert()
{
MyCommand.Comma ndText = "Select UserName from User_Login Where ID=' 1 ';
MyCommand.Comma ndType = CommandType.Tex t;
MyCommand.Conne ction = MyConnection;
MyAdapter.Selec tCommand = MyCommand;
MyAdapter.Fill( MyTable);
GridView1.DataS ource = MyTable.Default View;
GridView1.DataB ind();
MyAdapter.Dispo se();
MyCommand.Dispo se();
MyConnection.Di spose();
}
but in run time i found one error...
Data type mismatch in criteria expression.
pls solve my problem thanks
public void insert()
{
MyCommand.Comma ndText = "Select UserName from User_Login Where ID=' 1 ';
MyCommand.Comma ndType = CommandType.Tex t;
MyCommand.Conne ction = MyConnection;
MyAdapter.Selec tCommand = MyCommand;
MyAdapter.Fill( MyTable);
GridView1.DataS ource = MyTable.Default View;
GridView1.DataB ind();
MyAdapter.Dispo se();
MyCommand.Dispo se();
MyConnection.Di spose();
}
but in run time i found one error...
Data type mismatch in criteria expression.
pls solve my problem thanks
Comment