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. General Programming
  3. C#
  4. Access Data Table : Update / Insert

Access Data Table : Update / Insert

Scheduled Pinned Locked Moved C#
csshelpquestionannouncement
3 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.
  • R Offline
    R Offline
    Ravindra Bisen
    wrote on last edited by
    #1

    hi , i am using this code to insert a record into data table objCommand = new OleDbCommand(str, objConnection1); objCommand.Parameters.Add("@sid", OleDbType.Integer); objCommand.Parameters.Add("@nm", OleDbType.VarChar, 255); objCommand.Parameters["@sid"].Value = textBox1.Text; objCommand.Parameters["@nm"].Value = textBox2.Text.Trim(); objConnection1.Open(); data = objCommand.ExecuteNonQuery(); it works and it display that record in the grid when i reload data grid. BUT the the record does not store permanently in the table. IT dose not display that record when i restart the application. what is the problem...:rose:

    S R 2 Replies Last reply
    0
    • R Ravindra Bisen

      hi , i am using this code to insert a record into data table objCommand = new OleDbCommand(str, objConnection1); objCommand.Parameters.Add("@sid", OleDbType.Integer); objCommand.Parameters.Add("@nm", OleDbType.VarChar, 255); objCommand.Parameters["@sid"].Value = textBox1.Text; objCommand.Parameters["@nm"].Value = textBox2.Text.Trim(); objConnection1.Open(); data = objCommand.ExecuteNonQuery(); it works and it display that record in the grid when i reload data grid. BUT the the record does not store permanently in the table. IT dose not display that record when i restart the application. what is the problem...:rose:

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      What kind of database do you use? MS Access? Did you checked for the AutoCommit-flag? I'm just guessing, but maybe the internal transaction is not committed. Regards Sebastian

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      1 Reply Last reply
      0
      • R Ravindra Bisen

        hi , i am using this code to insert a record into data table objCommand = new OleDbCommand(str, objConnection1); objCommand.Parameters.Add("@sid", OleDbType.Integer); objCommand.Parameters.Add("@nm", OleDbType.VarChar, 255); objCommand.Parameters["@sid"].Value = textBox1.Text; objCommand.Parameters["@nm"].Value = textBox2.Text.Trim(); objConnection1.Open(); data = objCommand.ExecuteNonQuery(); it works and it display that record in the grid when i reload data grid. BUT the the record does not store permanently in the table. IT dose not display that record when i restart the application. what is the problem...:rose:

        R Offline
        R Offline
        Ravindra Bisen
        wrote on last edited by
        #3

        Hi after posting this threat i got the solution in the solution Explorer first i selected the mdb file; then changed the properties of mdb file.that is copy to output directory : copy if newer that's it !! :-\

        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