Hi,
How to import a text file to sql-server.i want to do it thro' code in vb.net...
Plz provide me with the steps or the code....
Thanks in advance..
Want to boost your .NET application performance?
Some developers always seem to write efficient and lightening-fast code. What is their secret? It’s ANTS Profiler. “We improved the performance of the application up to 10 times” Dan Ports, Intrigma.
Try it for yourself now.
You can make an external call to the BCP command utility. (go to a command prompt and type bcp for help on the command utility). Or you can write a SQL Procedure that does it and call it from VB.net. See http://www.sqlteam.com/article/using-bulk-insert-to-load-a-text-file for the details of the sproc.
I suppose a third option could include using Microsoft's odbc text driver to import the data into a dataset and to then call some additional ado.net code to insert the results into the sql database.
http://www.vbdotnetheaven.com/Uploadfile/mahesh/OdbcDotNetDataProvider04252005030215AM/OdbcDotNetDataProvider.aspx