C#通过文本文件使用ado.net连接并读取文件的内容. [英] C# use ado.net connection via a text file and read the contents of the file.

查看:130
本文介绍了C#通过文本文件使用ado.net连接并读取文件的内容.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C#使用ado.net连接文本文件(文本文件数据很大,有数千万行数据),当连接快速读取其内容时,谢谢.

C # using ado.net to connect a text file (text file data is large, there are tens of millions of rows of data), and when the connection is fast to read its contents, thank you.

推荐答案

您可以通过ADO.NET连接到文本文件,但无法如此快速地访问数千万的数据.正如我的社区朋友所提到的,如果不对数据建立索引,这是不可能的.另外,如果在选择查询中使用where子句,则需要索引数据库中的该列.

我希望使用SSIS包并在索引中将所有平面文件数据转移到登台表中.那么您可以快速访问这些数据.但是这里的快速并不代表毫秒..u应该考虑数据量.

谢谢
Subhendu
You can connect to a textfile thru ADO.NET but accessing tens of millions of data cant be read so fast. As mentioned by my community friends, this cant be possible without indexing the data. Also if you use the where clause in your select query, you need to index that column(s) in database.

I would prefer to transfer all the flat file data in staging table using SSIS package and indexing those data. then you can access those data fast. but here fast doesn''t mean with milliseconds..u should consider the amount of data.

Thanks
Subhendu


我不知道你在说什么.但是,如果您打算将文本文件用作数据库并希望它很快,那么就算了.数千万个未索引的行将变得非常缓慢.
I have no idea what you''re talking about. But, if you intend on using a text file as a database and expect it to be fast, forget it. Tens of millions of unindexed rows is just going to be brutally slow.


您根本无法一次读取那么多数据.您将必须对查询返回的数据更具选择性.我们有一个网页,该网页一次从400万条记录表中返回不超过250条记录.
You simply can''t read that much data at once. You''re going to have to be more selective iin the data returned from the query. We have a web page that returns no more than 250 records at a time from a 4-million record table.


这篇关于C#通过文本文件使用ado.net连接并读取文件的内容.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆