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. Database & SysAdmin
  3. Database
  4. OleDB using MS-Access

OleDB using MS-Access

Scheduled Pinned Locked Moved Database
graphics
3 Posts 3 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.
  • S Offline
    S Offline
    s4_sabahatf
    wrote on last edited by
    #1

    i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way /////////////////////////////////////////////////////////// OleDbConnection m_Connection = new OleDbConnection(Connection); m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb"; m_Connection.Open(); Connection ="INSERT INTO user =(1,1)";

    P H 2 Replies Last reply
    0
    • S s4_sabahatf

      i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way /////////////////////////////////////////////////////////// OleDbConnection m_Connection = new OleDbConnection(Connection); m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb"; m_Connection.Open(); Connection ="INSERT INTO user =(1,1)";

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      3 things: 1. Don't post your questions twice. 2. Your code won't compile. The last line references a variable that hasn't been declared. 3. You should learn basic SQL syntax before attempting anything more complicated. This site[^] should help.

      Paul Marfleet

      1 Reply Last reply
      0
      • S s4_sabahatf

        i m unable to insert record in table using OLeDb follwoing command.it is drawing unhandled expection,please do tell me the easiest way /////////////////////////////////////////////////////////// OleDbConnection m_Connection = new OleDbConnection(Connection); m_Connection.ConnectionString=@"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:use.mdb"; m_Connection.Open(); Connection ="INSERT INTO user =(1,1)";

        H Offline
        H Offline
        Hesham Amin
        wrote on last edited by
        #3

        You should create a command object, not pass the query to the constructor of the connection object. also the syntax of the SQL statement to insert is not true. It should be something like:

        INSERT INTO user values (1,1)
        

        that if the user table has just 2 columns. I think you really need to read about ADO.NET this can be a good place to start.[^]


        Hesham A. Amin My blog

        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