处理大ADODB记录在数据表中设置?数据表、ADODB

2023-09-07 10:24:35 作者:念旧的人

我加载了约3万行(ADODB记录集)大结果集到的数据表。它花费的时间太长,甚至加载结果集到一个数据表。我想找出提取结果集的一部分,然后加载到数据表中的一种方式。另外,就是加载到数据表,然后看它有没有办法直接读取记录,而不是直接?

这是在code我用它来填补我的数据表 -

  OleDbDataAdapter的oleDA =新OleDbDataAdapter的();
数据表DT =新的DataTable();
oleDA.Fill(DT,myADODBRecordset);
 

解决方案 碳核查六大行业补充数据表发布,填报要求更加细化

下面是一些要考虑的选项:

获取只有你真正需要使用的行和列。

获取一些数据,让用户请求下一组行他们想什么时候。

编写优化的SQL查询

不要使用一个数据表,除非你要因为它包含更多的元数据信息,其他列表类型的对象。

考虑使用托管.NET提供。

I am loading a large result set of about 3 million rows (ADODB record set) into a data table. Its taking too long to even load the result set into a data table. I want to find out a way of extracting only part of a result set and then loading it into a DataTable. Alternatively, is there a way to directly read the recordset directly instead of loading it into a data table and then reading it ?

This is the code I use to fill my DataTable -

OleDbDataAdapter oleDA = new OleDbDataAdapter();
DataTable dt = new DataTable();
oleDA.Fill(dt, myADODBRecordset);

解决方案

Here are some options to consider:

Get only the rows and columns you really need to work with.

Get some data and let the user ask for the next set of rows when they want to.

Write optimized SQL queries

Don't use a DataTable unless you have to because it contains more metadata information that other list-type objects.

Consider using a managed .NET provider.