Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
3
Reply
Delete in Local Database.
Wajid Usman
Jul 8 2014 3:19 PM
785
Reply
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;
}
}
Attachment:
error.rar
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Drawing line on chart area
Sharepoint add item to list using c#