Looking for work? Check out our jobs area.

.NET WinForms

Moderators: None (Apply to moderate this forum)
Number of threads: 104
Number of posts: 141

This Forum Only
Post New Thread

Report
Saving data back to dataset from textboxes Posted by ZOR2 on 5 Nov 2009 at 5:32 AM
Hi, I have texboxes with databindings. How do I save the data from a textbox when the textbox data is amended. Thanks

TextBox3.DataBindings.Clear()
TextBox4.DataBindings.Clear()

'MessageBox.Show("ID1 = " & dr("ID1").ToString & ", Barcode = " & dr("Barcode"))

Dim dr As DataRow = TXMastersDataset1.Tables("TXMasters").Rows(ListBox2.SelectedIndex)

Dim sql2 As MySqlCommand = New MySqlCommand("SELECT * FROM TXMasters WHERE TXMasters.ID1 = " & dr("ID1") & ";", con)

TXMastersDataset2 = New DataSet()
TXMastersDataAdaptor2 = New MySqlDataAdapter()
TXMastersDataAdaptor2.SelectCommand = sql2
TXMastersDataAdaptor2.Fill(TXMastersDataset2, "TXMasters")

TextBox3.DataBindings.Add(New Binding("Text", TXMastersDataset2, "TXMasters.Barcode"))
TextBox4.DataBindings.Add(New Binding("Text", TXMastersDataset2, "TXMasters.SportorSports"))



 
Popular resources and forums for programmers on Programmersheaven.com
Assembly, Basic, C, C#, C++, Delphi, Java, JavaScript, Pascal, Perl, PHP, Python, Ruby, Visual Basic
© Copyright 2009 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Publisher: Lars Hagelin. Read the latest words from the publisher here.
Be the first to sign up for Lars Hagelin’s In-depth Outsourcing Newsletter here.
bootstrapLabs Logo A bootstrapLabs project.