kescott
Posts: 49
|
Posted: 10/20/2008, 7:28 AM |
|
I want to count the number of rows inserted in a SqlBulkCopy function.
Here's a code snippet, from
http://www.sqlteam.com/article/use-sqlbulkcopy-to-quick...t-to-sql-server
static void CopyData(DataTable sourceTable, SqlConnection destConnection)
{
// new method: SQLBulkCopy:
using (SqlBulkCopy s = new SqlBulkCopy(destConnection))
{
s.DestinationTableName = "SalesCopy";
s.NotifyAfter = 10000;
s.SqlRowsCopied += new SqlRowsCopiedEventHandler(s_SqlRowsCopied);
s.WriteToServer(sourceTable);
s.Close();
}
}
I want a label on my page to grab the value of the "s.SqlRowsCopied" to the label EmployeesRowsCopied.Text. Any ideas how this can be done?
_________________
B.S. of Computer Science
Class of 2005
Norfolk State University
Norfolk, VA
http://www.nsu.edu
|