Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
there is no error but cmd query take input as -1.
selvi subramanian
Jun 14 2014 12:32 AM
750
Reply
please check the error
protected void dgrd_DeleteCommand(object source, DataGridCommandEventArgs e)
{
con = new SqlConnection(s);
// cmd = new SqlCommand("delete from section where sectionid='" + dgrd.DataKeys[e.Item.ItemIndex].ToString()+"'", con);
// cmd = new SqlCommand("delete from section where sectionid='" + dgrd.SelectedIndex.ToString()+"'", con);
cmd = new SqlCommand("delete from section where sectionid='" + dgrd.Items.ToString() + "'", con);
con.Open();
// int rows = cmd.ExecuteNonQuery();
//if (rows > 0)
//{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Deleted", "<script>alert('Deleted Successfully')</script>");
bid();
//}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
.net error exception
how to delete a a prticular row in datagrid using asp.net