Bulk Copy error The given value of type String from the data source cannot be converted to type nchar of the specified target column.

Nov 12 2009 8:07 AM
Hello,

I'm facing a problem when I try execute the follow code:

SqlBulkCopy bulkData = new SqlBulkCopy(_trans.Connection, SqlBulkCopyOptions.Default,_trans);
bulkData.DestinationTableName = "TB_TMP_CONTRATOS";
try
{
bulkData.WriteToServer(_dtContratos);
bulkData.Close();
}
catch(Exception e){}

I´m receiving an exception at write to server, that says "The given value of type String from the data source cannot be converted to type nchar of the specified target column."
I already look the number of columns, field size and everything is ok.
anybody can help me?
Tks in advance

Answers (8)