when first time click on delete button in datagriedview then delete row successfully again click on delete then no row delete or no action perform but why ....
same condition with edit button ...
how to solve this problem plz reply me ....
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Upendra Pratap ShahiPosted Jun 25, 2015, 7:33 AM
Nilesh JadavPosted Jun 25, 2015, 7:16 AM
Full tutorial:
http://www.aspdotnet-suresh.com/2011/02/how-to-inserteditupdate-and-delete-data.html
Upendra Pratap ShahiPosted Jun 25, 2015, 7:02 AM
{
con = new SqlConnection(dbcon);
cmd = new SqlCommand("Delete from Emp where Empid=" + DataGrid1.DataKeys[e.Item.ItemIndex].ToString(), con);
con.Open();
int rows = cmd.ExecuteNonQuery();
if (rows > 0)
{
Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Deleted", "");
con.Close();
BindData();
}
}
Jitendra SharmaPosted Jun 25, 2015, 6:59 AM
Jitendra SharmaPosted Jun 25, 2015, 6:58 AM
Upendra Pratap ShahiPosted Jun 25, 2015, 6:57 AM