|Not sure if it is a Sql issue or a syntax error of sorts so here it is.
I have a DataTable with a single column Player Name. It is filled with some 20,000 rows. I need to insert this into a Sql database.
I have a Sql database setup with a table called Unknown, it has 2 columns, an Indentity column ID, and a varchar(50) column Player Name.
I copied the data over one-by-one and it took like 15-30 minutes to do, not I am using SqlBulkCopy. The problem is, it simply isn't working. No error, no warnings, no nothing. I have SQL Profiler open and don't see it even hitting the database. Code is attached, what am I doing wrong?
SqlConnection connection = new SqlConnection(Properties.Settings.Default.TibiaSQLConnection);
SqlBulkCopy copier = new SqlBulkCopy(connection);
copier.BatchSize = 500;
copier.NotifyAfter = 1000;
copier.SqlRowsCopied += new SqlRowsCopiedEventHandler(copier_SqlRowsCopied);
copier.DestinationTableName = "Unknown";
The best way to accelerate a Macintosh is at 9.8m/sec² - Marcus Dolengo