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. ADO.NET help, editing data in a database

ADO.NET help, editing data in a database

Scheduled Pinned Locked Moved C#
csharpquestiondatabasehelpannouncement
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.
  • B Offline
    B Offline
    Blekk
    wrote on last edited by
    #1

    Hi, I didn't know where I should post this, but because it is in C# I thought this would be the best place, even though it is ADO.NET stuff. Anyway, I have a question, I have created a datasource to the northwind database and created a simple windows form. With the first name, last name textboxes etc. and to select the employees I use the listbox with the employees last names in it. I have added an the TextBox_Validate Event to each textbox with the code: private void TextBox_Validated(object sender, EventArgs e) { employeesTableAdapter.Update(northwndDataSet1.Employees); employeesTableAdapter.Fill(northwndDataSet1.Employees); } Yet, when I change a name, and then tab or click somewhere else, it doesn't update the database with the new name. What am I doing wrong? Thanks, Any reply is appreciated

    N L 2 Replies Last reply
    0
    • B Blekk

      Hi, I didn't know where I should post this, but because it is in C# I thought this would be the best place, even though it is ADO.NET stuff. Anyway, I have a question, I have created a datasource to the northwind database and created a simple windows form. With the first name, last name textboxes etc. and to select the employees I use the listbox with the employees last names in it. I have added an the TextBox_Validate Event to each textbox with the code: private void TextBox_Validated(object sender, EventArgs e) { employeesTableAdapter.Update(northwndDataSet1.Employees); employeesTableAdapter.Fill(northwndDataSet1.Employees); } Yet, when I change a name, and then tab or click somewhere else, it doesn't update the database with the new name. What am I doing wrong? Thanks, Any reply is appreciated

      N Offline
      N Offline
      Nader Elshehabi
      wrote on last edited by
      #2

      I've used ADO myself for sometime and have seen alot of errr.... Surperises you'd call them?!:-D Anyway, I'm sure the code is called, and that it's excuted without errors. From your code it looks like you've used the designer. Why didn't you use it to make the textboxes. It would update them automatically using a DataNavigator?

      Regards:rose:

      1 Reply Last reply
      0
      • B Blekk

        Hi, I didn't know where I should post this, but because it is in C# I thought this would be the best place, even though it is ADO.NET stuff. Anyway, I have a question, I have created a datasource to the northwind database and created a simple windows form. With the first name, last name textboxes etc. and to select the employees I use the listbox with the employees last names in it. I have added an the TextBox_Validate Event to each textbox with the code: private void TextBox_Validated(object sender, EventArgs e) { employeesTableAdapter.Update(northwndDataSet1.Employees); employeesTableAdapter.Fill(northwndDataSet1.Employees); } Yet, when I change a name, and then tab or click somewhere else, it doesn't update the database with the new name. What am I doing wrong? Thanks, Any reply is appreciated

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        Blekk wrote:

        What am I doing wrong?

        It would appear you did not look at the MANY database articles here on CodeProject. Give it a shot, I imagine it will help.

        led mike

        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