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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Run query in MS Access and get requested data

Run query in MS Access and get requested data

Scheduled Pinned Locked Moved C#
databasequestionhelp
2 Posts 1 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.
  • Y Offline
    Y Offline
    yonidebest
    wrote on last edited by
    #1

    Hi, I have an MS Access table and I wish to get information into a DataSet or DataTable using a SQL query. This is my code:

    string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" + @"DataSource=C:\Program Files\Wiki\WikiProject.mdb";
    // All_Data is the name of the table; City is the name of the Column; and New York is the row I want
    string commandString = "SELECT All_Data.* FROM All_Data WHERE ((All_Data.City)=New_York)";
    OleDbConnection con = new OleDbConnection(connectionString);
    OleDbDataAdapter dataAdapter = new OleDbDataAdapter(commandString, con);

    DataSet ds = new DataSet();
    dataAdapter.Fill(ds, "All_Data");

    The error I get is "Could not find installable ISAM". How can I solve this error? or - Is there another way to get a specific line from a MS Access table? Thanks, Yoni

    Y 1 Reply Last reply
    0
    • Y yonidebest

      Hi, I have an MS Access table and I wish to get information into a DataSet or DataTable using a SQL query. This is my code:

      string connectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" + @"DataSource=C:\Program Files\Wiki\WikiProject.mdb";
      // All_Data is the name of the table; City is the name of the Column; and New York is the row I want
      string commandString = "SELECT All_Data.* FROM All_Data WHERE ((All_Data.City)=New_York)";
      OleDbConnection con = new OleDbConnection(connectionString);
      OleDbDataAdapter dataAdapter = new OleDbDataAdapter(commandString, con);

      DataSet ds = new DataSet();
      dataAdapter.Fill(ds, "All_Data");

      The error I get is "Could not find installable ISAM". How can I solve this error? or - Is there another way to get a specific line from a MS Access table? Thanks, Yoni

      Y Offline
      Y Offline
      yonidebest
      wrote on last edited by
      #2

      Thanks, Yoni

      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