could anyone tell me how i can delete a row from the gridview and the database
public void getTasks()
{
SqlDataReader rdr = logik.loadData();
if (rdr == null || !rdr.HasRows)
{
GridView1.DataSource = rdr;
GridView1.DataBind();
}
else
{
GridView1.DataSource = rdr;
GridView1.DataBind();
GridView1.HeaderRow.Visible = false;
}
}
i have a guess about using rdr[0] cus thats the row id i guess.. but actually dont know how to implement..
i have a guess about using rdr[0] cus thats the row id i guess.. but actually dont know how to implement..

SUNIL GUTTARank #1,832 · 810 reputationPosted Jan 28, 2014, 10:04 AM EST
1) gridview_rowdeleting event 2) just writing a delete command to delete row from ds and update to sqlDB or perform operations directly on DB using DataReader ..
Actually 1st case suits your need just becoz i don't which row you intend to delete from n rows ..
// ID column of row in Gridview .
--------------------------------RATE THIS ANSWER AS HELPFUL , IF HELPS----------------
Priti KumariRank #414 · 6K reputationPosted Jan 28, 2014, 7:41 PM EST