Delete Button

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..
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories