Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Multi-part Exce Import to Sql Server

Reply
Thread Tools

Multi-part Exce Import to Sql Server

 
 
apporter apporter is offline
Junior Member
Join Date: Feb 2008
Posts: 2
 
      02-20-2008
Hi everyone, I have found alot of help from this site as I have just started my career. I am unable to find help on one specific topic anywhere though. I have an asp.net site that lets the user upload a file to the server and then the excel data is selected and sent to sql server and triggers a stored procedure which uses the data toproduce a new excel file for the user. However the files coming back are too large, so I need to find a way to split the return into multiple files using 200 records at a time from the import. I have no idea where to begin on this, any ideas would be appreciated.

Thanks,
Allen
 
Reply With Quote
 
 
 
 
apporter apporter is offline
Junior Member
Join Date: Feb 2008
Posts: 2
 
      02-20-2008
Maybe I can make the question more clear, I realize it's a bit spastic in my first post. Currently I have my asp.net page that has the user upload the excel file to the server. Then I use the following code to directly insert it into the Sql Server table:

Dim excelConnection = New OleDbConnection( _ "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source=C:\Inetpub\wwwroot\allen-test\incoming\" & c & ";" & _ "Extended Properties=""Excel 8.0;HDR=Yes;IMEX=1;""")

excelConnection.Open()

Dim excelCommand As New System.Data.oledb.OleDbCommand("INSERT INTO [ODBC; Driver={SQL Server};Server=xxxDB01;Database=xxDCC;UID=xxxxx;PW D=xxxxx].[tblGMTagPrint]SELECT [item id], [common code] FROM [sheet1$];", excelConnection)

This inserts the entire file into the table. From there I trigger stored procedures to get the output I need.

What I need to do now though is send the records to the table for processing 200 rows at a time. Hopefully that will be clearer and somebody can give me an idea of where to start.

Thanks,

Allen
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help. Getting a An error has occurred while establishing a connectionto the server. When connecting to SQL Server 2005, this failure may be causedby the fact that under the default settings SQL Server does not allow remote aboutjav.com@gmail.com ASP .Net 0 05-03-2008 12:43 PM
SQL? - Import XLS DBTYPE_WSTR to SQL DBTYPE_CY Phillip Vong ASP .Net 0 12-03-2006 09:33 PM
Do the Self-Paced Training Kits: Microsoft SQL Server 2000 include Eval copy of SQL Server? Brian Whiting Microsoft Certification 2 12-29-2005 04:24 AM
Exce and Perl Mark Seger Perl Misc 0 06-08-2005 09:37 AM
Can't connect to SQL Server, using Windows Authentication users of SQL server? help =?Utf-8?B?UmV6YQ==?= ASP .Net 3 06-07-2004 06:42 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57