ADO.net, asp.net & Bulk Copy

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




> 1. Is there a way of uploading a file to the sql
server from another PC?

Yes. You can use bulk insert text file to Db:

command.CommandText = "BULK INSERT db_table_name
FROM 'filepath\filename' WITH
(DATAFILETYPE = 'char', FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n')"
command.ExecuteNonQuery()

> 2. Is it possible to manipulate the data before
bulk inserting?
Yes. But you need read data to datatable first.

> 3. Is it possible to just bulk insert the data
from a Data Table/ Data Set?
In ADO.NET 2.0, SqlBulkCopy can write dataset to db
directly. In ADO.NET 1.X, you need implement your code.
Look at following URL
http://support.microsoft.com/kb/315968/EN-US/

HTH

Elton Wang
elton_wang@xxxxxxxxxxx


>
> Thank you
> Francis
>.
>
.