I have a DataTable with a column called Name.
DataTable dt = new DataTable();
DataColumn dc = new DataColumn();
dc.DataType = System.Type.GetType("System.String");
dc.ColumnName = "Name";
dt.Columns.Add(dc);
I’m trying to select only the DataRows that have what’s in the TextBox, but I don’t know how to . Here’s what I want.
dt.Select("string.Compare(Name.ToLower().Contains(" + textBox1.Text.ToLower() + ")");
Is there any way to do this with Select / should I even be attempting it?
You can use LINQ to Dataset to do this (via AsEnumerable):