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. Having trouble updating access database.

Having trouble updating access database.

Scheduled Pinned Locked Moved Database
databasehelpannouncement
1 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.
  • K Offline
    K Offline
    kornstyle
    wrote on last edited by
    #1

    I am writing a program that updates a access database. I am filling a dataset with data from a comma delimited text file. Then I insert the dataset into the database with this piece of code.

    OleDbAdapter.Update(dataSet1, "Table1");

    This works great, but I also need to insert records to the database using a SQL insert statement. I am using the code below to insert a single record to the database.

    "insert into Table1(col1, col2, col3)"
    + " values ('" + textBox1.Text + "', '"
    + textBox2.Text + "', '"
    + textBox3.Text + "')";

    This works great. The problem comes in when I try to insert another dataset. The correct number of records are added but every row is the same as the row from the SQL statement. I bound the dataset to a datagrid but the datagrid shows the correct data in each row. Please help me before I get fired. Thanks

    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