Column of last row
I NEED TO BIND A VALUE OF PARTICULAR COLUMN OF THE LAST ROW TO LABEL IN C#
2 Answers
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
RahulRank #1,857 · 800 reputationPosted Oct 31, 2014, 12:54 AM EDT
Get the row count and then get the last row and as particular column as shown in above code snippet.
Pulak deb92 reputationPosted Oct 31, 2014, 5:06 AM EDT
MySqlDataAdapter da = new MySqlDataAdapter(cmd.CommandText, con);
da.Fill(dt);
if (dt.Rows.Count >= 0)
{
GridView1.DataSource = dt;
GridView1.DataBind();
}