Tag - DataTable

How to select from Datatable in C#.NET

DataTable Object has a Select Method which acts like Where in SQL Server. So if you want to write filter query you write the column name directly without Where and the filter expression you want. I made a simple example that creates a DataTable and fill it with some data and use Select method: DataTable dt...

How to convert SqlDataSource to DataTable and DataView in C#.NET

Sometimes I want to use SqlDataSource  returned data programmatically and here is how you can do this, In this example I will assume that SqlDataSource  ID is SqlDataSource1 which is the default ID: DataSourceSelectArguments args = new DataSourceSelectArguments(); DataView view = SqlDataSource1.Select(args) as DataView; DataTable dt = view.ToTable();