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. Visual Basic
  4. Updating dataset

Updating dataset

Scheduled Pinned Locked Moved Visual Basic
databaseannouncement
4 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.
  • R Offline
    R Offline
    Radiska
    wrote on last edited by
    #1

    I put together a form with one text box on it. Add a database connection, dataadapter and create a dataset. I databind the text box through properties. I use the fill command to fill the textbox with data. I see the data. I edit the data and the dataset does not seem to accept it. If I do exactly the same thing using a datagrid instead of the textbox, it takes the change I made... All sample code that I can find deals with datagrids, there is nothing that I can find for a simple textbox. Figuered it out as follows: Dim nsn As String nsn = txtSchoolName.Text Me.DsSchoolInfo1.tbl_SchoolInfo.Rows(0).BeginEdit() Me.DsSchoolInfo1.tbl_SchoolInfo.Rows(0)("SchoolName") = nsn Me.DsSchoolInfo1.tbl_SchoolInfo.Rows(0).EndEdit() Try Me.DbaSchoolInfo1.Update(DsSchoolInfo1) Catch x As Exception End Try Me.Close()DSS -- modified at 20:57 Monday 1st May, 2006

    B 1 Reply Last reply
    0
    • R Radiska

      I put together a form with one text box on it. Add a database connection, dataadapter and create a dataset. I databind the text box through properties. I use the fill command to fill the textbox with data. I see the data. I edit the data and the dataset does not seem to accept it. If I do exactly the same thing using a datagrid instead of the textbox, it takes the change I made... All sample code that I can find deals with datagrids, there is nothing that I can find for a simple textbox. Figuered it out as follows: Dim nsn As String nsn = txtSchoolName.Text Me.DsSchoolInfo1.tbl_SchoolInfo.Rows(0).BeginEdit() Me.DsSchoolInfo1.tbl_SchoolInfo.Rows(0)("SchoolName") = nsn Me.DsSchoolInfo1.tbl_SchoolInfo.Rows(0).EndEdit() Try Me.DbaSchoolInfo1.Update(DsSchoolInfo1) Catch x As Exception End Try Me.Close()DSS -- modified at 20:57 Monday 1st May, 2006

      B Offline
      B Offline
      barnamehnevis_vbnet
      wrote on last edited by
      #2

      first locate datarow position ((me.bindingcontext(dataset,"ur tablename").position) then update it with a command builder: cb = new oledbcommandbuilder(da) da = cb.dataadapter da.update(ds,"yourtablename") good lock!:-D

      R 1 Reply Last reply
      0
      • B barnamehnevis_vbnet

        first locate datarow position ((me.bindingcontext(dataset,"ur tablename").position) then update it with a command builder: cb = new oledbcommandbuilder(da) da = cb.dataadapter da.update(ds,"yourtablename") good lock!:-D

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

        Thanks for the help. I was still not successful in my attempt trying with your proposed solution. I posted some code in my question that I tried as well... DSS

        C 1 Reply Last reply
        0
        • R Radiska

          Thanks for the help. I was still not successful in my attempt trying with your proposed solution. I posted some code in my question that I tried as well... DSS

          C Offline
          C Offline
          Chatura Dilan
          wrote on last edited by
          #4

          Sometimes, see your question is related to this http://www.codeproject.com/script/comments/forums.asp?msg=1401837&forumid=1646&Page=2&userid=2682888&mode=all#xx1401837xx[^]

          Regards,

          Chatura Dilan

          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