private static string SqlDBConnectionString = "Server=12831-QHOO\\SQLEXPRESS;Database=DBHome;Trusted_Connection=True;";
private static void SaveDataToDB(DataTable DT)
{
using (var bulkCopy = new SqlBulkCopy(SqlDBConnectionString, SqlBulkCopyOptions.KeepIdentity))
{
foreach (DataColumn col in DT.Columns)
{
bulkCopy.ColumnMappings.Add(col.ColumnName, col.ColumnName);//(DT.ColumnName,SQLTableColumnName)
}
bulkCopy.BulkCopyTimeout = 600;
bulkCopy.DestinationTableName = "DBHome";
bulkCopy.WriteToServer(DT);
}
}
I am attempting to connect to a local SQL Server database in C# using the above settings. In doing so, the code after what is shown above is not being executed, i.e. no data is being sent to the tables.
Is there a way to see if it's actually connecting to the database? I get no errors and an exit with code 0.