Multi-part Exce Import to Sql Server

Discussion in '.NET' started by apporter, Feb 20, 2008.

  1. apporter

    apporter

    Joined:
    Feb 20, 2008
    Messages:
    2
    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
    apporter, Feb 20, 2008
    #1
    1. Advertising

  2. apporter

    apporter

    Joined:
    Feb 20, 2008
    Messages:
    2
    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;PWD=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
    apporter, Feb 20, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UmV6YQ==?=
    Replies:
    3
    Views:
    17,883
    Carlos Barini
    Jun 7, 2004
  2. Daves
    Replies:
    1
    Views:
    360
    tom.pesterDeLeTeTHISSS@pandora.be
    Jun 13, 2005
  3. Phillip Vong
    Replies:
    0
    Views:
    981
    Phillip Vong
    Dec 3, 2006
  4. Jack
    Replies:
    8
    Views:
    261
  5. Mark Seger

    Exce and Perl

    Mark Seger, Jun 8, 2005, in forum: Perl Misc
    Replies:
    0
    Views:
    71
    Mark Seger
    Jun 8, 2005
Loading...

Share This Page