Quantcast
Channel: Programmers Heaven Forums RSS Feed
Viewing all articles
Browse latest Browse all 2703

Delete Button

$
0
0
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..

Viewing all articles
Browse latest Browse all 2703

Trending Articles