Hi .. I'm doing a program where i need the delete button .. Im having a problem with my code :
try
{
con.Open();
ad.DeleteCommand = new OleDbCommand("Delete from Mobile where MobileID= " + textBox1.Text + "", con);
ad.DeleteCommand.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
Every other thing works , add edit ... but here when i cant to delete it I get a message Syntax error ( missing operation) in query expression MobileID..
try
{
con.Open();
ad.DeleteCommand = new OleDbCommand("Delete from Mobile where MobileID= " + textBox1.Text + "", con);
ad.DeleteCommand.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
finally
{
con.Close();
Every other thing works , add edit ... but here when i cant to delete it I get a message Syntax error ( missing operation) in query expression MobileID..