from ASP to an excel file

Discussion in 'C#' started by ehud37new, Dec 4, 2008.

  1. #1
    I do have a form people need to put there details and I can see there details in my e mail after they send it...

    If I want that the details will be save on a excel file....
    How can I do it?

    after someone is send the form the information will be send to an e mail and also to some excel file ....

    where can i read on this subject ?


    :D
     
    ehud37new, Dec 4, 2008 IP
  2. sukkepan

    sukkepan Guest

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I believe that the easiest way would be to define a table like structure in Excel sheet, (create columns and name the sheet something like "formdata" or whatever you want) and then use the MS OLEDB provider to save the data to Excel as you would to any other data source. You can get the connection string required to do so on connectionstrings.com website.

    If you want to write the excel file directly (cell for cell) there are many options but most of them are way more complicated. For example you can use MS Office components if you have Office installed on your web server, or some third party components like "Aspose Cells" (personally, I prefer the latter when creating Excel files).
     
    sukkepan, Dec 4, 2008 IP
  3. mojo3120

    mojo3120 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You'd probably be better off just using Access for this. It'd probably be a lot easier to find a tutorial on this method as well. You could easily modify a basic tutorial to fit your needs.
     
    mojo3120, Dec 7, 2008 IP
  4. bibinsmk

    bibinsmk Active Member

    Messages:
    205
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    53
    #4
    This will handle simply. We can use excel file as like databases. We can insert values from the form to excel file using oledb adapter.

    Connection String

    Dim cons As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=" Name of excel file "; Jet OLEDB:Engine Type=5;" + "Extended Properties=Excel 8.0;")

    After the connection string normal ADO.net code we have use
     
    bibinsmk, Dec 8, 2008 IP