DataGridView1 (VS2005)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vbt

    #1

    DataGridView1 (VS2005)

    I am new to using the DataGridView and I have read most everything I can
    find on this subject. But obviously I am not see the hole picture.



    I am trying to update a data base using the DataGridView.



    The DataGridView displays the data correctly when the program is run. I am
    able to change the data in a cell but when I reload the data base the
    changes were never updated.



    DataGridView.Da taSource = GroupDataBindin gSource

    DataGridView.Ed itMode = EditOnEnter

    DataGridView.Co lumnsReadOnly = False



    The following is the code I am using to save the data:



    Private Sub SaveGroupData()

    Try

    Me.Validate()

    Me.GroupDataBin dingSource.EndE dit()

    'This line of code saves data into the
    Group_DBDataSet .Group_Data' table.

    Me.Group_DataTa bleAdapter.Upda te(Me.Group_DBD ataSet.Group_Da ta)



    Catch ex As Exception

    Dim msg As String

    msg = " Sub SaveGroupData " & vbCrLf & vbCrLf

    MsgBox(msg & ex.ToString) ' Show friendly error message.



    Finally



    End Try



    End Sub





    Any help will be appreicated


  • gene kelley

    #2
    Re: DataGridView1 (VS2005)

    On Sun, 19 Nov 2006 21:52:56 -0800, "vbt" <tbmcl@cwnet.co mwrote:
    >I am new to using the DataGridView and I have read most everything I can
    >find on this subject. But obviously I am not see the hole picture.
    >
    >
    >
    >I am trying to update a data base using the DataGridView.
    >
    >
    >
    >The DataGridView displays the data correctly when the program is run. I am
    >able to change the data in a cell but when I reload the data base the
    >changes were never updated.
    >
    >
    >
    >DataGridView.D ataSource = GroupDataBindin gSource
    >
    >DataGridView.E ditMode = EditOnEnter
    >
    >DataGridView.C olumnsReadOnly = False
    >
    >
    >
    >The following is the code I am using to save the data:
    >
    >
    >
    >Private Sub SaveGroupData()
    >
    Try
    >
    Me.Validate()
    >
    Me.GroupDataBin dingSource.EndE dit()
    >
    'This line of code saves data into the
    >Group_DBDataSe t.Group_Data' table.
    >
    Me.Group_DataTa bleAdapter.Upda te(Me.Group_DBD ataSet.Group_Da ta)
    >
    >
    >
    Catch ex As Exception
    >
    Dim msg As String
    >
    msg = " Sub SaveGroupData " & vbCrLf & vbCrLf
    >
    MsgBox(msg & ex.ToString) ' Show friendly error message.
    >
    >
    >
    Finally
    >
    >
    >
    End Try
    >
    >
    >
    End Sub
    >
    >
    >
    >
    >
    >Any help will be appreicated
    >
    Running & reloading from where?

    Try running and reloading from a release build and see what happens.

    Gene

    Comment

    • Ken Tucker [MVP]

      #3
      Re: DataGridView1 (VS2005)

      Hi,

      If you see the database in the solution explorer make sure its copy
      to output property is set to only if newer

      Ken
      --------------------------
      "vbt" <tbmcl@cwnet.co mwrote in message
      news:OMuXhgGDHH A.992@TK2MSFTNG P03.phx.gbl...
      >I am new to using the DataGridView and I have read most everything I can
      >find on this subject. But obviously I am not see the hole picture.
      >
      >
      >
      I am trying to update a data base using the DataGridView.
      >
      >
      >
      The DataGridView displays the data correctly when the program is run. I am
      able to change the data in a cell but when I reload the data base the
      changes were never updated.
      >
      >
      >
      DataGridView.Da taSource = GroupDataBindin gSource
      >
      DataGridView.Ed itMode = EditOnEnter
      >
      DataGridView.Co lumnsReadOnly = False
      >
      >
      >
      The following is the code I am using to save the data:
      >
      >
      >
      Private Sub SaveGroupData()
      >
      Try
      >
      Me.Validate()
      >
      Me.GroupDataBin dingSource.EndE dit()
      >
      'This line of code saves data into the
      Group_DBDataSet .Group_Data' table.
      >
      >
      Me.Group_DataTa bleAdapter.Upda te(Me.Group_DBD ataSet.Group_Da ta)
      >
      >
      >
      Catch ex As Exception
      >
      Dim msg As String
      >
      msg = " Sub SaveGroupData " & vbCrLf & vbCrLf
      >
      MsgBox(msg & ex.ToString) ' Show friendly error message.
      >
      >
      >
      Finally
      >
      >
      >
      End Try
      >
      >
      >
      End Sub
      >
      >
      >
      >
      >
      Any help will be appreicated
      >
      >

      Comment

      Working...