Import xls

Discussion in 'Databases' started by slynch401k, Oct 27, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I can upload a file to the server under a specific folder. Are we allowed to point to that file and import it into sql?

    Thanks
     
  2. You can use the xml for storage on your site but you would need to code a page to pull your nodes in and then write them to the SQL Server, unless you do it with LINQ.
    I've used LINQ with XML but haven't done that part.
     
  3. Wizemx, so what are you saying, import an xml file, and then code it to import to sql? Need to google it to get a start.
     
  4. Give me an idea of what's in the XML, how it was formed, and I'll try and find a solution for ya. ;-)
    The Screwrturn wiki for example can be configured to store all of it's data in XML.
     
  5. What I am trying to do, is allow the end user client, to be able to import data such as retirement contributions, from an xls or csv file, then verify the contributions, post to a table and allow the end user to verify and post the data.

    From searching this forum, I take it that DASP will not allow is to access an imported file placed on the server. I can place a control to upload the xls file so that is not a problem. The problem is accessing the file and appending the data to a table in sql.

    I need this function and need advise on a alternative or a different provider.

    Thanks for the help.
     
  6. ...I'm looking into this for you, will post what I find.
     
  7. Bruce

    Bruce DiscountASP.NET Staff

    Where do you get the idea that we do not allow application to upload files? You should be able to upload / create file with your application anywhere within your site.
     
  8. ...Thre seems to be some confusion.
    It was my understanding the need was to import the markup files into SQL Server.
    If so the solution I was looking for was to allow them to be uploaded to the Web server then pump them into SQL tables, from the user site.

    That was why I mentioned LINQ.

    Correct?
     
  9. Bruce:

    I can upload the xls files fine and have coded a page that allows this. The problem is accessing the file and importing it into sql from a client viewpoint.

    All I want to do is have the CLIENT (end user) upload an xls file (no problem I have done this via code) to a folder, then after the client uploads the file, run a stored procedure or code to import to a temp table in sql and then run some other functions.

    This has to be performed by the end user.
     
  10. Use OLEDB or ADO.NET to read the spreadsheet which will enable you import the spreadsheet data into a database. Both are fully supported server side on the DASP web server.
     
  11. Thanks crystal.

    I will try it tomorrow. I think I found code to do it. Someone else recommended the following:

    You can also try to use DTS from MS SQL.

    1. Create DTS, referring to the file stored on the server
    2. Check if manual import works fine
    3. Write stored procedure that will start this DTS
    4. Upload the file to the server
    5. Change its name to the one defined in DTS
    6. Execute stored procedure (p.3)
    7. Check for errors

    So I will explore both tomorrow.
     
  12. I'm glad Joe chipped in, the entire time, due to my background with XML so many years ago, I thought this thread was about the style sheets for data to and from SQL Server used in XML. Never occured to me we were talking about Excel. ;-)
    /FacePalm
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page