Delete in Local Database.
hi i am deleting a data in local database in c# visual studio but it gives an error in it. i have pasted here a function of deleting and a screen shot of error please help me to solve this.
public int drugDelete(string particulars)
{
try
{
string strCommand = "DELETE FROM IA WHERE Particulars='" + particulars;
SqlCeCommand cmdDelete = new SqlCeCommand();
cmdDelete.Connection = conn;
cmdDelete.CommandType = CommandType.Text;
cmdDelete.CommandText = strCommand;
return cmdDelete.ExecuteNonQuery();
}
catch (SqlCeException e)
{
MessageBox.Show(e.Source + "\n" + e.Message + "\n" + e.StackTrace);
return -1;
}
}