ASP upload excel dat to database.

asp India
  • 14 years ago

    Hi guys,  Whisper [:-*]
               Can someone tell me how to upload data from excel sheets to tables in SQL Server i want to do this using ASP.The Excel file is on client machine and assume the data is correct.

    Better idea wht i think will be to upload the file to the server and run a stored proc which will read coulmn by column, validate and insert row into the table. But how to read data from an xls file from a SP. hmmmmmm also how to upload the xls file......

    Or can there be a better solution than this, if not how can i achieve the above idea......

    Regards,
    ASD.Smiley Face [:)]

     

     

     

     

     

  • 14 years ago

    Hi guys,

          Problem solved no need to worry abt it. Except i will have few other problems on this regards.

    Regards,

    ASD.

  • 14 years ago

    Hi guys,

    After successfully uploading the csv file to the database i have done some error checking and error logging. The client requirement was to abort the entire transaction even if one record in not able to be inserted in the databse.

    I have done this using <%Transaction=Required%> in my ASP page. And on error of insert i abort the transaction (rollback) and do the proper error logging.

    Alls fine uptil now, i have submitted the files to the client, well he says, he is getting error the the object is closed. And says it wrks fine if he comments <%Transaction=Required%>. But obviously we require transaction. So wht could be conflicting and causing the error "Object Closed".

    He and i are using SQL Server 2000, i guess its regarding some setting issues of the server, but thts a guess......how come its wrking on my system and not in his ???????????????/

    Any thought pls,

    Regards,
    ASD.

  • 14 years ago

    Hi ASD,

    I'm newby in this classic ASP using excel and DB. Can you share with me how we can do that in term of logic and also the code?

    Many thanks,

    Keith

     

     

     

  • 14 years ago

    Hi Ashutosh,

    While using transactions the Microsoft distributed transaction coordinator (MS DTC) service is used.

    You could verify the settings for the service in the Component services section. As according to you the program works fine if the transaction is commented this could be one of the issues.

    Regards
      Udai K

  • 14 years ago

    Hi skqi,
         Sorry I haven't been intouch with the forum, hence the delay. I really wanted to share my experience tht i got doing this tiny project.

    I would soon post an article on how to upload the CSV file to the DB with the code of parsing the CSV file.

    Regards,
    ASD.

  • 14 years ago
    Hi ashutosh,
      Could you please help me , Regarding uploading .xzl file , parsing the contents and storing records in to SQL data base using ASP.NET 2.0.
    Regards,
    kv.




  • 14 years ago

    Hi venkat,
        I have done the coding in asp, but i have given the same assignment to a friend of mine to do it in asp.net. Maybe she can help you with tht. I will talk to her.

    Regards,
    ASD.

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“If Java had true garbage collection, most programs would delete themselves upon execution.” - Robert Sewell