Home All Groups Group Topic Archive Search About
Author
22 Jun 2006 11:16 PM
GB
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

Author
22 Jun 2006 11:29 PM
David Browne
"GB" <v7v***@hotmail.com> wrote in message
news:rxFmg.82061$771.53222@edtnps89...
Show quote
> 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?
>

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

AddThis Social Bookmark Button