selvi subramanian

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();
//}
}

Answers (1)