shamim shamim - 1 month ago 12
ASP.NET (C#) Question

How to save multiple column in database

I have a text file.I need to get data from this text file and show on grid ,

1)After this user can update information from gridview,
2)Click on save button save data on database.


Before clicking on button data don't save on database.How to do that?

Answer

"In my text file, I have more than 1000 rows, how to save them in temp database? I want to save them by using stored procedure, how to save multiple bits of data by executing one procedure?"

You can use SqlClient.SqlBulkCopy class for this.

The textfile can be the source for the bulk copy:

http://blog.stevienova.com/2008/01/16/net-fastest-way-to-load-text-file-to-sql-sqlbulkcopy/

Comments