.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Import from excel

Posted By:      Posted Date: September 10, 2010    Points: 0   Category :ASP.Net
Hi All,   i have some questions, i receive an excelfile on a daily base. This excel file should be imported into a database.I have a couple of questions about it. 1.  Every line in the excelfile represents one record, but there are a lot of fields, like a persons name, adres, city. But also about items he or she has purchased. Now my idea was to create two seperate tables for the persons and for the items, than create a table for the join of the person and the purchased item. Would this would be a proper way, or should i leave all items in one table? 2. in case of creating two different tables, what would be the best way to extract the data en divided it over the two tables? so that a relationship stands..   I am using SQL2008 (MS)   Thanks in advance !!   Peter  

View Complete Post

More Related Resource Links

how to import the data of excel into gridview1 using asp.net/c#

i m having excel file a.xlsi m having gridview1,fileupload1how to import excel file from fileupload1 get the destination of a.xls and show the values in gridview1if any boby knows full code answer/mail me at ponmanivannangj@mobiusservices.in

Import Excel spreadsheet To Sharepoint List

Hi, I am having sharepoint 2010 RTM trial on Windows Server 2008 SP2. I want to populate csv filke data to new sharepoint list. I am using custom List Wizard to achieve this... When I Import csv on server then everything is fine but when i inport csv from client, i get the following error "The Specified is not valid Spreadsheet or contains no data to import" I have also checked to import excel workbook but it gives the same error on client and do great on server..... can anybody have any idea what is wrong ?? thanks

Text truncated to 255 using SSIS ACE.oledbprovider to import excel 2007 spreadsheet

Hi All, Trying to use SSIS SQL 2005 to import an Excel 2007 file (.xlsx). I'm using Office 12.0 Access Database Engine OLEDB Provider with extended properties Excel 12.0;HDR=Yes;IMEX=1 The problem is when I have text with more than 255 characters. It basically defaults the source output to Unicode string[DT_WSTR] 255, If I change it it errors out. I have done the registry change according to http://msdn.microsoft.com/en-us/library/ms141683.aspx but I think it only applies to Excel source not OleDb Source. (A Excel source does give me a text instead of string )   I have also tried to increasing the length of output such as 4000 instead of 255 but it doesn't allow either.   Anybody can help?I'm stuck for a day. Thank you very much for your help. Regards, Koala  

Import Excel data into SQL Server express 2008

I have recently installed SQL express 08 and created a table to import excel data into.  Im running on a windows 7 64 bit OS i5 processor.  I've disabled the firewall (temporarily) and will set the necessary ports once this is working. I run the following query:  (which i found from multiple sources on the net) Select   * From OPENROWSET ( 'Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\Users\Public\lenovoBkup\contacts\outlookFiles\noib2a.xls', 'Select * From [sheet1$]' )  and receive the following message: Msg 7308, Level 16, State 1, Line 1                                                                                  OLE DB provider 'Microsoft.Jet.OLEDB.4.0' cannot be used for distributed queries because the provider is configured to run in single-threaded apartment mode.  (how did they know i was single and living in an apartment? lol) so after research of the following message i restarted the system and relaunched man

import multiple Excel 2007 files using openrowset

hello, I Have a folder that includes multiple excle files (ver 2007), i am trying  to loop through each file using vbscript to import its data to sql 2000 using openrowset but i am getting this error in the openrowset line "[Microsoft][ODBC sql server driver] [sql server] [OLE/DB provider returned message: the microsoft office access DB engine cannot open or write to the file '', it is already open exclusively by another user or you need permission to view or write its data] code 80040E14 source microsoft OLEDB provider for ODBC drivers Any help please    

SSIS Excel import skip first rows

Hello,1. Is it possible during import data from Excel to DB table skip first 6 rows for example?2. Also Excel data divided by sections with headers. Is it possible for example to skip every 12th row?Thank you,V. A.

Import excel sheet data to datagrid without using oledb

In my application(C#) i want to import excel sheet to show its data in DatatGridView i dont want to use oledb Need sample code can any any Help

Import Excel data into SQL db

 First off sorry if this is in the wrong place but there are over a dozen forum sections here and this seems to be the only one that comes close to what I need.. anyway ... I'm trying to use Visual Web Developer 2008 express to create a form that will allow a user to select an excel file and upload it's values to SQL. I found the following code in another post but as I'm a newbie to C# I'm confused about what 'using' items it needs to run. I keep getting errors like 'System.Web.UI.Page.Application' is a 'property' but is used like a 'type' and "The type or namespace name 'Workbook' could not be found (are you missing a using directive or an assembly reference?)" So what kind of obvious stuff am I overlooking? Or is this just an impossible task for a web app?  1 public DataSet GetExcel(string fileName)2 {3 Application oXL;4 Workbook oWB;5 Worksheet oSheet;6 Range oRng;7 try8 {9 // creat a Application object10 oXL = new ApplicationClass();11 // get WorkBook object12 oWB = oXL.Workbooks.Open(fileName, Missing.Value, Missing.Value, Missing.Value, Missing.Value, Missing.Value,13 Missing.Value,

How to import Data from Excel to SQL Server Express

 Hi,  please any one is expert in Data Base help me, i would like to import two Data columns from Excel file 2003 instead of two columns in a table in Sql Server Express 2005 , How Can i do that? and what is the way if I have Sql Developer 2005, thank you .  

How to import two excel files into one list?

I know that I can export Excel data into new list in MOSS 2010 via Excel 2010. But when I was trying to add data into existing list, it was impossible. I know one way - copy data in Excel and paste it into the list in DataSheet View. Is there another way?

Simple Excel Import Question

I have an excel file I am importing into a table. The excel file is named with a date (02102010_Excel_file.xls). I created a very simple import package. This simple two object package - Excel Source to OLE DB destination works just fine. But..   My problem is that the Excel file name will change every day to todays date (09162010_ExcelFile.xls) So,  I need to change my Excel Import  to something like *.xls but that doesn't work. How can I Import a *.xls file? qeqw

data type problem in import data from excel file


Dear All,

I am importing the data from excel file using following code.

connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(strFolderFileName) & ";Extended Properties=HTML Import;"
                conn = New OleDbConnection(connstr)
                Dim strSQL As String = "SELECT * FROM [" & strWorkSheetName & "]"

                Dim cmd As New OleDbCommand(strSQL, conn)

                Dim da As New OleDbDataAdapter(cmd)

Now the problem is if a coulmn vlaue start with a number value like "15" then the other string value like "W15" in that column is ignored in the datatable.

eg. The excel column value     Column1


How to import excel cell value preceding with '00'



        I am trying to import an excel file in SQL Server 2005 through "OPENROWSET" command.But the problem is in excel there is a column with cell values preceding with '0's.e.g. '000987','000008' etc..the excel file has rows more than a lakhs so manually edit each row is absurd. but while I'm trying to import the data its getting values without the preceding '0's....So please suggest me how do I import the data through SQL Server scripting...


Import Excel to SQL Server

Hi, I want to import spreadsheet from network computer to SQL Server 2008 R2 database, I want to each user can write to database easly their data from excel spreadsheet in real-time, and can refresh their spreadsheet with the new data.

Can explain me how to do this and send me code to try ?


Import Excel File in SQL Server


Dear all,

I have to create one page where user will upload the excel file in SQl Server and system should check following things

1.Sheet Name should be always sheet1

2.System should check the column names

3.System should show the message that these many rows has been loaded



Import Access table or Excel spreadsheet into Oracle table


I am trying to import from an Excel spreadsheet or an Access database into an Oracle table.  I used the SSIS Import and Export wizard to create the SSIS packages, but everytime that I attempt to run the package, SSIS stops once it gets to the Pre-Execute phase.  There are never any errors.  Am I doing something that cannot be done?

I'm using the following:  SSIS 2005, Microsoft Oracle OLEDB provider (MSDAORA.1), Excel and Access 2003

By the way, I am able to successfully export from the Oracle database to either Excel or Access using SSIS.


Import Excel-File (OPENROWSET) on x64 SQL Server


Hi, recently I encountered the following problem:

I tried to execute a stored procedure on the newly installed SQL 2005 Server (now on x64 Win Server 2003) which imports an Excel-File into a DB table.

We use OPENROWSET to access the Excel data. But I recognized this is dependent on Jet OLE DB which seems is not available for x64 windows.


Is there another way to import excel data using a stored procedure.


thank you in advance, rene

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend