4
Answers

cannot convert type 'datarow ' to 'datatable.' c#

I have a dataset, that contain list of rows. I want last row from the dataset. Then asign this dataset to datatable.
 
  1. DataTable dt = (DataTable)ds.Tables[0].Rows[ds.Tables[0].Rows.Count - 1];    
How to solve this error? 
Answers (4)