Ok so here's the thing, I used to read in data from an excel file and bulk copy this data into a SQL table and everything worked fine. But now, my source file changed, so now i get data from a other excel file. Both file look exactly the same, I can still read in the data through the program, but now, when I bulk copy the data to a SQL table, instead of inserting the values, it inserts "NULL" into the column...I just don't know what is going on. My program still works fine with the other source file.
My BulkCopy Code:
using (SqlBulkCopy bulkCopy = new SqlBulkCopy(thisConnection))
{
bulkCopy.DestinationTableName =
"tbl_" + Release.Text + "_NEW_VERSION_FILE";
try
{
bulkCopy.WriteToServer(AddTermTable);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
thisConnection.Close();
Console.ReadLine();
}
finally
{
thisConnection.Close();
}
}
Attached (GUI) , you will see a picture of my GUI that has the data from the New source file attached to a datagrid.
The second attachment is a picture of how it looks in SQL.
Can anyone help me understand this?