all groups > sql server programming > june 2006 >
You're in the

sql server programming

group:

SqlBulkCopy problem



Re: SqlBulkCopy problem David Browne
6/22/2006 6:29:38 PM
sql server programming:
[quoted text, click to view]

Hmm. I don't know. Try creating your DataTable using a DataAdapter with a
query of the form

select * from MyTable
where 1=2

Then ADO.NET will build the matching DataTable for you. At least you can
see if there is any difference between that DataTable and the one you
manufactured from scratch.

David
SqlBulkCopy problem GB
6/22/2006 11:16:39 PM
Hello:
I am developing C# project, using ADO .NET 2.0 to connect to SQL Server
2005.
I created a DataTable from scratch, and then use SqlBulkCopy to insert it
into an empty table in a SQL Server 2005 table.
The datatable I created from scratch matches exactly the empty SQL Server
2005 table.

However, when this runs I get the error:

Exception {"OLE DB provider 'STREAM' for linked server '(null)' returned
invalid data for column '[!BulkInsert].MyField. "} System.Exception
{System.Data.SqlClient.SqlException}

But for SQL Server 2000 everything is OK!

Could you please give me a hint how to fix the problem?

Thanks,
GB



AddThis Social Bookmark Button