hi, all
I want to delete row which point value = 1 form datatable.
How to delete row from datatable
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Riya SehgalRank #2,288 · 616 reputationPosted Jul 6, 2011, 12:18 AM EDT
You can try with below code.
sqlcmd = New SqlCommand("select * from emp", sqlcon) sqlcon.Open() da = New SqlDataAdapter(sqlcmd) dt.Clear() da.Fill(dt) If dt.Rows.Count > 0 Then 'Here i delete "First" row and bind it in grid view dt.Rows(1).Delete() GridView1.DataSource = dt GridView1.DataBind() End If