Results 1 to 3 of 3

Thread: Reading from Excel file

  1. #1

    Thread Starter
    Fanatic Member uniquegodwin's Avatar
    Join Date
    Jul 2005
    Location
    Chennai,India
    Posts
    694

    Question Reading from Excel file

    Hello guys,
    I will be really Thankful if someone would help me with this..
    Im trying to read from an Excel file..
    This is the code I am trying
    VB Code:
    1. Dim conn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Test.xls;Extended Properties=""Excel 8.0;HDR=YES;""")
    2.      Dim excelcmd As New OleDb.OleDbCommand("Select * from Field Level analysis")

    What I basically need help with is...What do you consider as a table in an excel sheet? How do we actually send a select query to an excel sheet...For example,I would like to retrieve all the records on the first sheet..How do I do that?

    Thanks,
    Godwin

    Help someone else with what someone helped you!

  2. #2
    Addicted Member bgard68's Avatar
    Join Date
    Mar 2006
    Location
    Arkansas
    Posts
    164

    Re: Reading from Excel file

    Using Framework 1.1, VB.Net 2003 unless I
    state otherwise

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Reading from Excel file

    See www.connectionstrings.com. It has an example of a query with the Excel connection string.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width