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. Update database from DataGridView?

Update database from DataGridView?

Scheduled Pinned Locked Moved C#
csharpdatabasevisual-studiotutorialquestion
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.
  • K Offline
    K Offline
    kbalias
    wrote on last edited by
    #1

    Hi I am using C# and Visual Studio 2005 to develop a Windows Application. I use the designer to bind a DataGridView to a table in a MS Access database. When I use the designer the following code is automatically generated in the Form_Load method:

    // TODO: This line of code loads data into the 'patientStatusDataSet2.bv_Patients' table. You can move, or remove it, as needed.
    this.procPatientList_AllInfoTableAdapter.Fill(this.patientStatusDataSet.procPatientList_AllInfo);

    I try to update the database when changes have been made to the data in the DataGridView, but cannot find what to use or how to do it. In the past I used to write my own code and could do updates. I am trying now to learn about the built-in functionality, but I am struggling. Neither procPatientList_AllInfoTableAdapter nor patientStatusDataSet has any Update methods. Any assistance will be appreciated. Thanks. Kobus

    V V 2 Replies Last reply
    0
    • K kbalias

      Hi I am using C# and Visual Studio 2005 to develop a Windows Application. I use the designer to bind a DataGridView to a table in a MS Access database. When I use the designer the following code is automatically generated in the Form_Load method:

      // TODO: This line of code loads data into the 'patientStatusDataSet2.bv_Patients' table. You can move, or remove it, as needed.
      this.procPatientList_AllInfoTableAdapter.Fill(this.patientStatusDataSet.procPatientList_AllInfo);

      I try to update the database when changes have been made to the data in the DataGridView, but cannot find what to use or how to do it. In the past I used to write my own code and could do updates. I am trying now to learn about the built-in functionality, but I am struggling. Neither procPatientList_AllInfoTableAdapter nor patientStatusDataSet has any Update methods. Any assistance will be appreciated. Thanks. Kobus

      V Offline
      V Offline
      vlinker
      wrote on last edited by
      #2

      See this[^] or you can search in google with keyword CommandBuilder

      1 Reply Last reply
      0
      • K kbalias

        Hi I am using C# and Visual Studio 2005 to develop a Windows Application. I use the designer to bind a DataGridView to a table in a MS Access database. When I use the designer the following code is automatically generated in the Form_Load method:

        // TODO: This line of code loads data into the 'patientStatusDataSet2.bv_Patients' table. You can move, or remove it, as needed.
        this.procPatientList_AllInfoTableAdapter.Fill(this.patientStatusDataSet.procPatientList_AllInfo);

        I try to update the database when changes have been made to the data in the DataGridView, but cannot find what to use or how to do it. In the past I used to write my own code and could do updates. I am trying now to learn about the built-in functionality, but I am struggling. Neither procPatientList_AllInfoTableAdapter nor patientStatusDataSet has any Update methods. Any assistance will be appreciated. Thanks. Kobus

        V Offline
        V Offline
        Vimalsoft Pty Ltd
        wrote on last edited by
        #3

        Dave Kreskowiak(CodeProject) tought me to Stop using wizards when am doing my Daatabase work. wizards have limitation and its not easy to debug if you did not write the code for yourself. i suggest you start writting your data layer so that you can see what is the Problem. as you said you use to write the code your self, why did you stop because its the best way of doing things, i have an Article that can get you started on how to update a Datagrid. http://www.codeproject.com/KB/cs/N-Tier22.aspx[^] Hope i Helped

        Vuyiswa Maseko, Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers." C#/VB.NET/SQL7/2000/2005/2008 http://vuyiswamb.007ihost.com http://Ecadre.007ihost.com vuyiswam@its.co.za

        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