internal BulkInsertProvider GetProvider() { var provider = new BulkInsertProvider(); var connection = new SqlConnection(SessionData.ConnectionString); SessionData.ConnectionTimeout = connection.ConnectionTimeout > 36000 ? connection.ConnectionTimeout : 36000; provider.Connection = connection; provider.BatchSize = SessionData.BatchSize; var tableInfo = GetTable(SessionData.TableName); if (tableInfo == null) return provider; provider.TableName = tableInfo.Name; var cmd = SqlTextCommand(tableInfo.Name); cmd.Parameters.Add("@batchSize", SqlDbType.Int).Value = SessionData.BatchSize; cmd.Parameters.Add("@batchIndex", SqlDbType.Int).Value = SessionData.BatchIndex; provider.SelectBulkRows = cmd; return provider; }
internal BulkInsertProvider GetProvider() { var provider = new BulkInsertProvider(); var connection = new SqlConnection(SessionData.ConnectionString); SessionData.ConnectionTimeout = connection.ConnectionTimeout > 36000 ? connection.ConnectionTimeout : 36000; provider.Connection = connection; provider.BatchSize = SessionData.BatchSize; var tableInfo = GetTable(SessionData.TableName); if (tableInfo == null) { return(provider); } provider.TableName = tableInfo.Name; var cmd = SqlTextCommand(tableInfo.Name); cmd.Parameters.Add("@batchSize", SqlDbType.Int).Value = SessionData.BatchSize; cmd.Parameters.Add("@batchIndex", SqlDbType.Int).Value = SessionData.BatchIndex; provider.SelectBulkRows = cmd; return(provider); }