In this post, Get the row index using LINQ in C# based on column
Ex :
int rowindex = new System.Data.DataView(datatable).ToTable(false, new[] { "Columname" })
.AsEnumerable()
.Select(row => row.Field<string>("Columname")) .ToList()
.FindIndex(col => col == variablewithvalue);
Happy Coding:)
Ex :
int rowindex = new System.Data.DataView(datatable).ToTable(false, new[] { "Columname" })
.AsEnumerable()
.Select(row => row.Field<string>("Columname")) .ToList()
.FindIndex(col => col == variablewithvalue);
Happy Coding:)
No comments:
Post a Comment