F
Frank Uray
Hi all
I am looking for the fastest way to fill a DataTable from a SQL Query.
I have already tried the DataAdapter.Fill and DataTable.Load Methods.
As farest I see, there is not much difference between these two methods.
Does anybody know a faster way to get a DataTable filled ?
For a native connection to SQL Server I use:
Data Source=Server\Instance;Initial Catalog=someDatabase;Integrated
Security=SSPI;
Thanks a lot and best regards
Frank Uray
return_DataAdapter = new System.Data.SqlClient.SqlDataAdapter(Query,
return_Connection);
local_DataTable.BeginLoadData();
return_DataAdapter.Fill(local_DataTable);
local_DataTable.EndLoadData();
return_Command.CommandText = Query;
return_Command.Connection = return_Connection;
return_DataReader = return_Command.ExecuteReader();
local_DataTable.BeginLoadData();
local_DataTable.Load(return_DataReader);
local_DataTable.EndLoadData();
I am looking for the fastest way to fill a DataTable from a SQL Query.
I have already tried the DataAdapter.Fill and DataTable.Load Methods.
As farest I see, there is not much difference between these two methods.
Does anybody know a faster way to get a DataTable filled ?
For a native connection to SQL Server I use:
Data Source=Server\Instance;Initial Catalog=someDatabase;Integrated
Security=SSPI;
Thanks a lot and best regards
Frank Uray
return_DataAdapter = new System.Data.SqlClient.SqlDataAdapter(Query,
return_Connection);
local_DataTable.BeginLoadData();
return_DataAdapter.Fill(local_DataTable);
local_DataTable.EndLoadData();
return_Command.CommandText = Query;
return_Command.Connection = return_Connection;
return_DataReader = return_Command.ExecuteReader();
local_DataTable.BeginLoadData();
local_DataTable.Load(return_DataReader);
local_DataTable.EndLoadData();