Gowtham manju

Gowtham manju

  • NA
  • 188
  • 80.7k

error in grid view reg

Jun 2 2011 6:34 AM
Hi,

I use following code to retrive the values from grid view to label


ds = autosql.ShowDatas("SELECT * FROM Fax_Tablename");
if (ds.Tables[0].Rows.Count > 0)
{
lbl_id.Text = ds.Tables[0].Rows[0]["cmid"].ToString();

}




den i selected the GridView1_RowDeleting command in grid view to delete the selected row
as query

delete from Fax_tablename where cid='" + lbl_id.Text + "' "</pre>

if i select the delete button in grid view it deletes the first value in database since i am using

<pre>ds.Tables[0].Rows.Count 


but my problem is

i need to delete the selected row in grid view on clicking the delete button



waiting for ur responces
thanks in advance


regards,
gowtham


Answers (1)