Using Garbage Collection after import

  • Thread starter Thread starter SteveB
  • Start date Start date
S

SteveB

Hi All,

I am using the SqlBulkCopy for import data into ms sql 2005. I need to
import multipe files which could be from 1 to GB each. Is there need to use
a garbage collection for this purpose since the files are pretty big.

Thanks,

Steve
 
as long as you use a using statement (or call dispose) then no worries.

using (var conn = new SqlConnection(connectionString))
{
conn.Open();
using (var bulkCopy = new SqlBulkCopy(conn))
{
// copy code here
}
}

if you are doing file i/o, be sure also use a using.


-- bruce (sqlwork.com)
 
Thanks Bruce.
as long as you use a using statement (or call dispose) then no worries.

using (var conn = new SqlConnection(connectionString))
{
conn.Open();
using (var bulkCopy = new SqlBulkCopy(conn))
{
// copy code here
}
}

if you are doing file i/o, be sure also use a using.


-- bruce (sqlwork.com)
 
Back
Top