Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. ODBC.NET and Excel

ODBC.NET and Excel

Scheduled Pinned Locked Moved Database
questioncsharpdatabasecomsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Knappen
    wrote on last edited by
    #1

    Hello I want to open a Excel-file in ADO.NET as a DataSet. I downloaded the ODBC.NET. and made a DSN-file pointing to the excel-file. Then I made a connection to the DSN-file in the Server-explorer. So far so good. But when I try to use the generated connectionString opening a OleDbConnection. I get the following error: The .Net Data Ole DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers. ----- My connectionString looks like this: Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DBQ=G:\costumers\foretag.xls;DefaultDir=G:\costumers;Driver={Driver do Microsoft Excel(*.xls)};DriverId=790;FIL=excel 8.0;FILEDSN=G:\costumers\foretag.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;ReadOnly=0;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;" How do I do this?

    P 1 Reply Last reply
    0
    • K Knappen

      Hello I want to open a Excel-file in ADO.NET as a DataSet. I downloaded the ODBC.NET. and made a DSN-file pointing to the excel-file. Then I made a connection to the DSN-file in the Server-explorer. So far so good. But when I try to use the generated connectionString opening a OleDbConnection. I get the following error: The .Net Data Ole DB Provider(System.Data.OleDb) does not support the MSDASQL Provider, Microsoft OLE DB Provider for ODBC Drivers. ----- My connectionString looks like this: Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="DBQ=G:\costumers\foretag.xls;DefaultDir=G:\costumers;Driver={Driver do Microsoft Excel(*.xls)};DriverId=790;FIL=excel 8.0;FILEDSN=G:\costumers\foretag.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;ReadOnly=0;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;" How do I do this?

      P Offline
      P Offline
      Paul Riley
      wrote on last edited by
      #2

      The ODBC.NET installation includes a new namespace: Microsoft.Data.Odbc as opposed to System.Data.OleDb. You need to be opening an OdbcConnection instead of an OleDbConnection. If you want to add this to your toolbox, right-click the Data toolbox, select "Customize Toolbox", go to the .NET Framework Components tab and check the boxes next to the Odbc... objects. Paul

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups