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. Display data from ms access database.....

Display data from ms access database.....

Scheduled Pinned Locked Moved C#
databasehelp
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
    raj231362
    wrote on last edited by
    #1

    hello everyone, i have a prop in displaying data from access database. i didn't under stand where i done mistake. i want to edit save data from database.when user enter emp_code and click edit button, then he displa all specific records related to that emp_id. help me...!!

    M 1 Reply Last reply
    0
    • R raj231362

      hello everyone, i have a prop in displaying data from access database. i didn't under stand where i done mistake. i want to edit save data from database.when user enter emp_code and click edit button, then he displa all specific records related to that emp_id. help me...!!

      M Offline
      M Offline
      Matjaz xyz
      wrote on last edited by
      #2

      u could put some more info on wheres the problem with a sample code and more description...

      Força Barça!

      R 1 Reply Last reply
      0
      • M Matjaz xyz

        u could put some more info on wheres the problem with a sample code and more description...

        Força Barça!

        R Offline
        R Offline
        raj231362
        wrote on last edited by
        #3

        here is my code..... for delete:- private void button3_Click(object sender, EventArgs e) { conn.Open(); string command1 = "delete from employee where (emp_id = ? AND emp_code = ? AND emp_name = ? AND emp_address = ? AND emp_dob = ? AND emp_doj = ? AND emp_dor = ?)"; OleDbDataAdapter da = new OleDbDataAdapter(command1, conn); DataSet ds = new DataSet(); da.Fill(ds); DataTable dt = ds.Tables[0]; conn.Close(); } for edit:-- private void button2_Click(object sender, EventArgs e) { conn.Open(); string sqlcom = "select emp_id,emp_code,emp_name,emp_address,emp_dob,emp_doj,emp_dor from employee where (emp_code=?)"; OleDbDataAdapter da = new OleDbDataAdapter(sqlcom , conn); DataSet ds = new DataSet(); //ds.Clear(); da.Fill(ds); if (ds.Tables[0].Rows.Count > 0) { int a = Convert.ToInt32(ds.Tables[0].Rows[0]["emp_id"]); textemp_id.Text = a.ToString(); } else { MessageBox.Show("This E-Code does not exist"); } conn.Close(); } i am new in c#..this code is not working..if any change plz modify it. 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