I want to import data from excel to sql server 2005. I am using C# for this purpose. I successfully exported the data of general format to varchar. But, the problem arises while exporting the data of date type. I have used date format in excel and want to export it in sql server 2005's datetime field. The code that I have used is:- SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection); sqlBulk.DestinationTableName = "Data_Master_Inventory"; sqlBulk.ColumnMappings.Add("VendorRegistrationNo", "VendorRegistrationNo"); sqlBulk.ColumnMappings.Add("ProductCode", "ProductCode"); sqlBulk.ColumnMappings.Add("SerialNo", "SerialNo"); sqlBulk.ColumnMappings.Add("VendorProvidedSerialNo", "VendorProvidedSerialNo"); sqlBulk.ColumnMappings.Add("ModelName", "ModelName"); sqlBulk.ColumnMappings.Add("ProductCategoryCode", "ProductCategoryCode"); sqlBulk.ColumnMappings.Add("InventoryDate", "InventoryDate"); sqlBulk.WriteToServer(dReader); Please provide me necessary solution.
rahul honey
Posts
-
How to Import data from excel to sql server 2005 -
How to import data from excel to sql server 2005I want to import data from excel to sql server 2005. I am using C# for this purpose. I successfully exported the data of general format to varchar. But, the problem arises while exporting the data of date type. I have used date format in excel and want to export it in sql server 2005's datetime field. The code that I have used is:- SqlBulkCopy sqlBulk = new SqlBulkCopy(strConnection); sqlBulk.DestinationTableName = "Data_Master_Inventory"; sqlBulk.ColumnMappings.Add("VendorRegistrationNo", "VendorRegistrationNo"); sqlBulk.ColumnMappings.Add("ProductCode", "ProductCode"); sqlBulk.ColumnMappings.Add("SerialNo", "SerialNo"); sqlBulk.ColumnMappings.Add("VendorProvidedSerialNo", "VendorProvidedSerialNo"); sqlBulk.ColumnMappings.Add("ModelName", "ModelName"); sqlBulk.ColumnMappings.Add("ProductCategoryCode", "ProductCategoryCode"); sqlBulk.ColumnMappings.Add("InventoryDate", "InventoryDate"); sqlBulk.WriteToServer(dReader); Please provide me necessary solution.
-
how to insert an image dynamically into a tablethank you sir I will try your suggestion
-
inserting image into a table at runtimeok sir I will get back to you if many problem related to c# will arrive
-
how to insert an image dynamically into a tableI am actually generating barcodes. Now each cell have some information related with a product along with it's barcode generated at runtime. Now please tell me how can I place this barcode image at a specific position in a cell using coordinates & coding in c#. I am using asp.net 3.5
-
inserting image into a table at runtimeok, sir thank you for giving your time to me.
-
inserting image into a table at runtimesir, I have to explain you the whole scenario. I am actually generating barcodes. Now each cell have some information related with a product along with it's barcode generated at runtime. Now please tell me how can I place this barcode image at a specific position in a cell using coordinates & coding in c#.
-
inserting image into a table at runtimeI am using asp.net
-
inserting image into a table at runtimeI am generating a table. each cell of that table has some information & an image. now I want to assign a specific location to that image in each cell at runtime. please provide me necessary solution