TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
selvi subramanian
NA
799
571.9k
there is no error but cmd query take input as -1.
Jun 14 2014 12:32 AM
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();
//}
}
Reply
Answers (
1
)
.net error exception
how to delete a a prticular row in datagrid using asp.net