开发者

Updating multiple records by reading one record at a time in C#, .Net-2005

开发者 https://www.devze.com 2023-01-22 20:51 出处:网络
My requirement is to read a line from text file and check in database if record exist then update it.

My requirement is to read a line from text file and check in database if record exist then update it. Reading one lin开发者_如何学运维e from file and fetching and updating a single record in db is much time consumming as text file contains milions of lines. So here we have to read and update only one record at a time.

Is there any way of reading a record and updating it and storing it temporarely (may be like in dataset or datatable),I am expeactiong solution like to update record and store it somewhere temporarely when file reading complete then will update records back to database.

I am using c# and .Net 2005. Is there any way to do records updation like this, which will increase updation performanance.


Bulk-import the text file into a temporary table and then perform the update on the main table from the temporary one

0

精彩评论

暂无评论...
验证码 换一张
取 消