Importing
-
I want to import excel sheet into my database. Can anybody help me to find any article or books to find how to do this(asp.net/c#).
-
I want to import excel sheet into my database. Can anybody help me to find any article or books to find how to do this(asp.net/c#).
Open enetrprise SQL Server Select the database Select Tables, Right Click , select All tasks, select Import Data Click Next Choose Microsoft Excel 97-2000 Browse the file to import click Next Choose the destination Database clcik Next Click Next Select the Sheet name and the table name you want to import click Next
Regards, Sylvester G sylvester_g_m@yahoo.com
-
Open enetrprise SQL Server Select the database Select Tables, Right Click , select All tasks, select Import Data Click Next Choose Microsoft Excel 97-2000 Browse the file to import click Next Choose the destination Database clcik Next Click Next Select the Sheet name and the table name you want to import click Next
Regards, Sylvester G sylvester_g_m@yahoo.com
-
Try this way..
private void GetData() { try { if(FileName.Text.EndsWith("xls")) { string connection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ FileName.Text + ";Extended Properties=Excel 8.0;"; DataSet bulkData=new DataSet() ; OleDbDataAdapter adap = new OleDbDataAdapter("SELECT [Postal/Kommune], HouseType, KommuneNumber, PostalCode, StreetCode, HouseNumber, Floor, SideDoorNumber FROM [" + SheetName.Text + "$]", connection); adap.Fill(bulkData); if(bulkData!=null) if(bulkData.Tables[0].Rows.Count>0) { BulkPropertyBLL bulkpropertyBll = new BulkPropertyBLL(); for(int i=0;i Regards, Sylvester G sylvester_g_m@yahoo.com