Skip to main content

Posts

Showing posts with the label SQL

Importing a CSV file using BULK INSERT command into SQL Server table

public void BulkUpload(DataTable prodSalesData)     {         //DataTable prodSalesData = new DataTable("ProductSalesData");         // Create Column 1: SaleDate         DataColumn dateColumn = new DataColumn();         dateColumn.DataType = Type.GetType("System.DateTime");         dateColumn.ColumnName = "SaleDate";         // Create Column 2: ProductName         DataColumn productNameColumn = new DataColumn();         productNameColumn.ColumnName = "ProductName";         // Create Column 3: TotalSales         DataColumn totalSalesColumn = new DataColumn();         totalSalesColumn.DataType = Type.GetType("System.Int32");         totalSalesColumn.ColumnName = "TotalSales";         // Add the columns to...