import issue in bit values

i have a issue in importing bit values in to database using SqlBulkCopy
Creating object of datatable :

  tblcsv.Columns.Add("EmailOptOut");
                tblcsv.Columns.Add("IsConverted");

Mapping Table column :

           objbulk.ColumnMappings.Add("EmailOptOut", "EmailOptOut");
             objbulk.ColumnMappings.Add("IsConverted", "IsConverted");


these are the bit column in sql database.when i am trying import,it showing some error
like
 "The given value of type String from the data source cannot be converted to type money of the specified bit column"
karthik80cAsked:
Who is Participating?
 
Russ SuterConnect With a Mentor Commented:
What are the data types of the columns in your DataTable (the one named tblcsv)? They need to be of either type System.Boolean or System.Data.SqlTypes.Bit.
0
 
Vitor MontalvãoConnect With a Mentor MSSQL Senior EngineerCommented:
Do you have null values? If so you'll need to test it first before converting.
0
 
karthik80cAuthor Commented:
thank you for your suggestions.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.