¡@

Home 

c# Programming Glossary: datatable

LINQ query on a DataTable

http://stackoverflow.com/questions/10855/linq-query-on-a-datatable

query on a DataTable I'm trying to perform a LINQ query on a DataTable object and.. on a DataTable I'm trying to perform a LINQ query on a DataTable object and bizarrely I am finding that performing such queries.. and bizarrely I am finding that performing such queries on DataTables is not straightforward. For example var results from myRow..

Create Excel (.XLS and .XLSX) file from C# [closed]

http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp

Plus it has a DataSetHelper that lets you use DataSets and DataTables to easily work with Excel data. ExcelLibrary seems to still.. the data set and table DataSet ds new DataSet New_DataSet DataTable dt new DataTable New_DataTable Set the locale for each ds.Locale.. table DataSet ds new DataSet New_DataSet DataTable dt new DataTable New_DataTable Set the locale for each ds.Locale System.Threading.Thread.CurrentThread.CurrentCulture..

Convert generic List/Enumerable to DataTable?

http://stackoverflow.com/questions/564366/convert-generic-list-enumerable-to-datatable

generic List Enumerable to DataTable I have few methods that returns different Generic Lists. Exists.. work of course but i would like to have the posibility of DataTable dt DataTable whatever Thanks in advance. Kind Regards. Josema... but i would like to have the posibility of DataTable dt DataTable whatever Thanks in advance. Kind Regards. Josema. c# list generics..

ExecuteReader requires an open and available Connection. The connection's current state is Connecting

http://stackoverflow.com/questions/9705637/executereader-requires-an-open-and-available-connection-the-connections-curren

you could also use a SqlDataReader instead note that a DataTable does not need to be disposed since it does not implement IDisposable.. it does not implement IDisposable var tblPromotion new DataTable avoid SQL Injection da.SelectCommand.Parameters.Add @PromotionID..

How to read a CSV file into a .NET Datatable

http://stackoverflow.com/questions/1050112/how-to-read-a-csv-file-into-a-net-datatable

load a CSV file into a System.Data.DataTable creating the datatable based on the CSV file Is there a class library for this or can.. or can I use ADO.net to connect to the file c# .net csv datatable share improve this question Here's an excellent class that.. Here's an excellent class that will copy CSV data into a datatable using the structure of the data to create the DataTable A portable..

How to select distinct values from datatable?

http://stackoverflow.com/questions/1199176/how-to-select-distinct-values-from-datatable

to select distinct values from datatable How to select distinct values from datatable in C# For a retrieved.. values from datatable How to select distinct values from datatable in C# For a retrieved data from database I need to get its distinct.. database I need to get its distinct value in C# c# select datatable distinct share improve this question DataView view new DataView..

Convert IEnumerable to DataTable

http://stackoverflow.com/questions/1253725/convert-ienumerable-to-datatable

BindingFlags.Instance Add the properties as columns to the datatable foreach var prop in props Type propType prop.PropertyType Is.. propType Add the property values per T as rows to the datatable foreach var item in items var values new object props.Length.. item null table.Rows.Add values return table c# datatable ienumerable share improve this question Look at this one..

Compare two DataTables to determine rows in one but not the other

http://stackoverflow.com/questions/164144/compare-two-datatables-to-determine-rows-in-one-but-not-the-other

seems to be very intensive if the tables become large. c# datatable share improve this question would I have to iterate through..

Export DataTable to Excel File

http://stackoverflow.com/questions/1746701/export-datatable-to-excel-file

in an Excel File.Please help. Thanks Vix c# asp.net excel datatable export share improve this question use this code... dt city.GetAllCity.. this question use this code... dt city.GetAllCity your datatable string attachment attachment filename city.xls Response.ClearContent..

How do you convert a DataTable into a generic list?

http://stackoverflow.com/questions/208532/how-do-you-convert-a-datatable-into-a-generic-list

list.Add dr Is there a better magic way c# generics datatable share improve this question If you're using .NET 3.5 you..

Can I find out the return value before returning while debugging in Visual Studio

http://stackoverflow.com/questions/268048/can-i-find-out-the-return-value-before-returning-while-debugging-in-visual-studi

in an aspx page. The only way to inspect the returned datatable is to use a temporary variable... However that's a bit inconvenient...

Advantages of Cache vs Session

http://stackoverflow.com/questions/428634/advantages-of-cache-vs-session

Cache vs Session What is the difference between storing a datatable in Session v.s Cache Advantages and disadvantages So if it is.. if it is a simple search page which returns results in a datatable and binds to a gridview. If user a searches and user b searches..

Convert DataTable to generic List?

http://stackoverflow.com/questions/545328/convert-datatable-to-generic-list

ANTS Profiler to give us more details. c# .net generics datatable share improve this question That won't be an actual leak..

Convert generic List/Enumerable to DataTable?

http://stackoverflow.com/questions/564366/convert-generic-list-enumerable-to-datatable

class static method or whatever to convert any list into a datatable The only thing that i can imagine is use Reflection to do this... Thanks in advance. Kind Regards. Josema. c# list generics datatable poco share improve this question Here's a nice 2013 update..

Inner join of DataTables in C#

http://stackoverflow.com/questions/665754/inner-join-of-datatables-in-c-sharp

can be done in C# code in a simple way Thanks. c# join datatable inner join share improve this question If you are allowed..

.NET - Convert Generic Collection to DataTable

http://stackoverflow.com/questions/701223/net-convert-generic-collection-to-datatable

properties fields in my class c# generics collections datatable nullable share improve this question Then presumably you'll..

Exception using CopyToDataTable with “new {..}” LINQ query

http://stackoverflow.com/questions/1072120/exception-using-copytodatatable-with-new-linq-query

as I expected. var bmwCars from car in dataTable.AsEnumerable where car.Field string Make .ToLower .Equals bmw.. I can't call CopyToDataTable why var bmwCars from car in dataTable.AsEnumerable where car.Field string Make .ToLower .Equals bmw.. question Based on your use of Field T the objects in dataTable which I am assuming are of type Car inherit DataRow . This is..

Combining n DataTables into a Single DataTable

http://stackoverflow.com/questions/12278978/combining-n-datatables-into-a-single-datatable

int nTmpVolTabIdx 1 strSqlTmp String.Empty using DataTable dataTableALL new DataTable while true string strTmpVolName String.Format.. data from 'VolX' into a local DataTable. using DataTable dataTable UtilsDB.DTFromDB conn strTmpVolName strSqlTmp false if dataTable.. UtilsDB.DTFromDB conn strTmpVolName strSqlTmp false if dataTable null break else dataTableALL.Merge dataTable nTmpVolTabIdx..

How to force ADO.Net to use only the System.String DataType in the readers TableSchema

http://stackoverflow.com/questions/2567673/how-to-force-ado-net-to-use-only-the-system-string-datatype-in-the-readers-table

OleDbDataReader reader cmd.ExecuteReader using DataTable dataTable new DataTable TestTable dataTable.Load reader base.SourceDataSet.Tables.Add.. using DataTable dataTable new DataTable TestTable dataTable.Load reader base.SourceDataSet.Tables.Add dataTable c#.. dataTable.Load reader base.SourceDataSet.Tables.Add dataTable c# excel types oledbconnection share improve this question..

Convert DataTable to IEnumerable<T>

http://stackoverflow.com/questions/3392612/convert-datatable-to-ienumerablet

IEnumerable TankReading ConvertToTankReadings DataTable dataTable var tankReadings new List TankReading foreach DataRow row in.. tankReadings new List TankReading foreach DataRow row in dataTable.Rows var tankReading new TankReading TankReadingsID Convert.ToInt32.. IEnumerable TankReading ConvertToTankReadings DataTable dataTable foreach DataRow row in dataTable.Rows yield return new TankReading..

ValueInjecter and DataTable

http://stackoverflow.com/questions/5462671/valueinjecter-and-datatable

var list new List T list.InjectFrom MyFromDataTableInj dataTable actually in your case you are going to use this injection only..

Filtering DataGridView without changing datasource

http://stackoverflow.com/questions/5843537/filtering-datagridview-without-changing-datasource

OK I've problem with 3rd one 1. datagridview.DataSource dataTable it works so I can filter by setting dataTable.DefaultView.RowFilter.. dataTable it works so I can filter by setting dataTable.DefaultView.RowFilter country LIKE ' s ' DataTable dt new DataTable.. using designer put the DataSet from toolbox on form add dataTable to it and then set datagridview.DataSource dataSource and datagridview.DataMember..

How to convert a GridView to DataTable and sort the DataTable?

http://stackoverflow.com/questions/5947780/how-to-convert-a-gridview-to-datatable-and-sort-the-datatable

object sender GridViewSortEventArgs e DataTable dataTable ViewState dtbl as DataTable if dataTable null DataView dataView.. e DataTable dataTable ViewState dtbl as DataTable if dataTable null DataView dataView new DataView dataTable dataView.Sort.. if dataTable null DataView dataView new DataView dataTable dataView.Sort e.SortExpression ConvertSortDirection e.SortDirection..

Read SQL Table into C# DataTable

http://stackoverflow.com/questions/6073382/read-sql-table-into-c-sharp-datatable

class PullDataTest your data table private DataTable dataTable public PullDataTest your method to pull data from database..

How to store datatable in cache to reuse it?

http://stackoverflow.com/questions/6831665/how-to-store-datatable-in-cache-to-reuse-it

public DataTable GetDataTableFromCacheOrDatabase DataTable dataTable HttpContext.Current.Cache secret key as DataTable if dataTable.. HttpContext.Current.Cache secret key as DataTable if dataTable null dataTable GetDataTableFromDatabase HttpContext.Current.Cache.. secret key as DataTable if dataTable null dataTable GetDataTableFromDatabase HttpContext.Current.Cache secret key..

Convert and use DataTable in WPF DataGrid?

http://stackoverflow.com/questions/6984686/convert-and-use-datatable-in-wpf-datagrid

In normal WinForm application you can do that DataTable dataTable new DataTable dataTable dataGridRecords.DataSource but how to.. you can do that DataTable dataTable new DataTable dataTable dataGridRecords.DataSource but how to do that with the WPF datagrid.. but how to do that with the WPF datagrid dataTable dataGridRecords.ItemsSource won't work either. c# wpf datagrid..

How to read a CSV file into a .NET Datatable

http://stackoverflow.com/questions/1050112/how-to-read-a-csv-file-into-a-net-datatable

to read a CSV file into a .NET Datatable How can I load a CSV file into a System.Data.DataTable creating..

Datatable select with multiple conditions

http://stackoverflow.com/questions/1990946/datatable-select-with-multiple-conditions

select with multiple conditions I have a datatable with 4 columns.. the set of data rows should do it. Is there a way to use Datatable.Select to accomplish this To be more specific can I have multiple..

Datatable vs Dataset

http://stackoverflow.com/questions/2250/datatable-vs-dataset

vs Dataset I currently use a datatable to get results from..

Best way to remove duplicate entries from a data table

http://stackoverflow.com/questions/4415519/best-way-to-remove-duplicate-entries-from-a-data-table

DataRow dRow in duplicateList dTable.Rows.Remove dRow Datatable which contains unique records will be return as output. return..

Generate pdf file after retrieving the information [closed]

http://stackoverflow.com/questions/5244348/generate-pdf-file-after-retrieving-the-information

yourdatatable.DefaultView get data from DB in Datatable grd.DataBind grd.RenderControl hw StringReader sr new StringReader..

How to convert a GridView to DataTable and sort the DataTable?

http://stackoverflow.com/questions/5947780/how-to-convert-a-gridview-to-datatable-and-sort-the-datatable

datatable share improve this question Put your Datatable in Viewstate when you bind first time gridView1.DataBind ViewState..

Datatable Select() Method

http://stackoverflow.com/questions/7836037/datatable-select-method

Select Method I have a Datagridview and the Data Source is..

How To Change DataType of a DataColumn in a DataTable?

http://stackoverflow.com/questions/9028029/how-to-change-datatype-of-a-datacolumn-in-a-datatable

this question You cannot change the DataType after the Datatable is filled with data. However you can clone the Data table change..