SqlBulkCopy的问题,望高手指教
//MessageBox.Show(dtDataSource.Rows.Count.ToString());
SqlBulkCopy sbcBulkCopy = new SqlBulkCopy(szSQLConnection,SqlBulkCopyOptions.UseInternalTransaction);
sbcBulkCopy.BulkCopyTimeout = 500000000;
sbcBulkCopy.NotifyAfter = dtDataSource.Rows.Count;
sbcBulkCopy.DestinationTableName = szSQLTableName;
try
{
sbcBulkCopy.WriteToServer(dtDataSource);
}
catch (Exception exMessage)
{ //错误信息处理
fnInsertSQLDBException(Login.szUserName, exMessage.Message, DateTime.Now);
}
MessageBox.Show(dtDataSource.Rows.Count.ToString());
这一句可正常显示2W多条。但不知道为什么录不进去。请高手看看。
------解决方案--------------------赶快接分!!!