I have a dataset, that contain list of rows. I want last row from the dataset. Then asign this dataset to datatable.
- DataTable dt = (DataTable)ds.Tables[0].Rows[ds.Tables[0].Rows.Count - 1];
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
Manas MohapatraRank #182 · 13.2K reputationPosted Nov 25, 2016, 9:33 PM EST
Rajeesh MenothRank #118 · 18.4K reputationPosted Nov 25, 2016, 8:08 PM EST
Manas MohapatraRank #182 · 13.2K reputationPosted Nov 25, 2016, 8:22 PM EST
DataRow drow = (DataRow)ds.Tables[0].Rows[ds.Tables[0].Rows.Count - 1];
DataTable dt = new DataTable();
dt.Rows.Add(drow);
Abhilash J ARank #1,243 · 1.4K reputationPosted Nov 25, 2016, 8:58 PM EST