How to find DataTable Row Number without ID column.

Hello All,

In ASP.NET one of my favourite topic is playing with DataSet and DataTable. Today one of my colleague asked me "how to find row number of DataTable if we dont have ID column".

Here is a simple way to do it:

int iRowNumber = objDT.Rows.IndexOf(objDT.Select("Name = Varsha")[0]);

iRowNumber will have Row number.

Hope that helps.

Please leave your comments to help me improve my blog.

Thank You for visiting the Blog. Happy Coding! :)

No comments:

Post a Comment