shamim shamim - 8 months ago 60
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?


"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: