About 740,000 results
Open links in new tab
  1. c# - How do I create a DataTable, then add rows to it? - Stack …

    4 In addition to the other answers. If you control the structure of the DataTable there is a shortcut for adding rows: // Assume you have a data table defined as in your example named dt …

  2. c# - Querying Datatable with where condition - Stack Overflow

    Mar 30, 2012 · I have a datatable with two columns, Column 1 = "EmpID" Column 2 = "EmpName" I want to query the datatable, against the column EmpID and Empname. For …

  3. c# - LINQ query on a DataTable - Stack Overflow

    Aug 14, 2008 · I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example: var …

  4. c# - How to export DataTable to Excel - Stack Overflow

    How can I export a DataTable to Excel in C#? I am using Windows Forms. The DataTable is associated with a DataGridView control. I have to export records of DataTable to Excel.

  5. c# - How to iterate through a DataTable - Stack Overflow

    Feb 26, 2015 · I need to iterate through a DataTable. I have a column there named ImagePath. When I am using DataReader I do it this way: SqlDataReader dr = null; dr = …

  6. c# - How to select distinct rows in a datatable and store into an …

    Jul 29, 2009 · The most simple solution is to use LINQ and then transform the result to a DataTable //data is a DataTable that you want to change DataTable result = …

  7. How to read SQL Table data into a C# DataTable - Stack Overflow

    May 20, 2011 · I've read a lot of posts about inserting a DataTable into a SQL table, but how can I pull a SQL table into a C#/.NET DataTable?

  8. c# - Convert DataTable to List<T> - Stack Overflow

    Sep 15, 2009 · I have an strongly typed DataTable of type MyType, I'd like convert it in a List&lt;MyType&gt;. How can I do this ? Thanks.

  9. c# - How to read a CSV file into a .NET Datatable - Stack Overflow

    Jun 26, 2009 · How can I load a CSV file into a System.Data.DataTable, creating the datatable based on the CSV file? Does the regular ADO.net functionality allow this?

  10. c# - Print Contents Of A DataTable - Stack Overflow

    Currently I have code which looks up a database table through a SQL connection and inserts the top five rows into a Datatable (Table). using (SqlCommand _cmd = new SqlCommand …