Bulk Copy Fail

  • Thread starter Thread starter ad
  • Start date Start date
A

ad

I use SqlBulkCopy to write a DataTable into a table of a database, but it
fail with message:
Can not convert a string type of datasource into bit type of Destination
Table.
I want to know which filed cause the problem.
How can I do?
 
Ad:

Have you specified ColumnMappings? If not, then just check positionally in
your datatable and sql table. Whichever fields are Bit in sql, check their
position and then compare to the DataTable. If you do have column mappings,
do the same thing but look at the data instead and see what's causing the
problem.
 
Hi, Sir
How can I check positionally in your datatable and sql table to find
which fields are Bit in sql, check their position and then compare to the
DataTable?



"W.G. Ryan [MVP]"
 
Back
Top