Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
FORM APP (C#) > DELETE PROBLEM SQL-!DATABASE
felix connely
May 8 2015 6:45 PM
561
Reply
Please check to the code block!
I would delete selected rows on gridview. But
i also would like to delete this selected rows which i choice on gridview IS also delete from database. but it doesnt work! HELP ME ! WHERE I MAKE MISTAKE !
private void button3_Delete(object sender, EventArgs e)
{
con.Open();
SqlCommand komut = new SqlCommand("delete from ME where pid = pid", con);
int row = Convert.ToInt32(dataGridView1.Rows[0].Selected);
if (row != 0)
{
dataGridView1.Rows.RemoveAt(row);
}
komut.ExecuteNonQuery();
con.Close();
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Stored Procedure
Storing web content c# .NET