Hi,
Edit the value in the datasource instead of the textbox to
change it with code.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim strConn As String
Dim strSQL As String
Dim da As OleDbDataAdapter
Dim ds As New DataSet
Dim conn As OleDbConnection
strConn = "Provider = Microsoft.Jet.OLEDB.4.0;"
strConn &= "Data Source = Northwind.mdb;"
conn = New OleDbConnection(strConn)
da = New OleDbDataAdapter("Select * From Categories", conn)
da.Fill(ds, "Categories")
txtName.DataBindings.Add("Text", ds.Tables("Categories"), "CategoryName")
Dim dr As DataRow = ds.Tables("Categories").Rows(0)
dr.BeginEdit()
dr.Item("CategoryName") = "Hello World"
dr.EndEdit()
End Sub
Ken
----------------------
[quoted text, click to view] "Juanjo" <SinSpam@SeViveMejor.com> wrote in message
news:e66o6jVbEHA.3476@tk2msftngp13.phx.gbl...
> Hi,
>
> I have a form with one Tabcontrol who has two TabPages with two
> Textboxes
> binded to a DataSet. I have the next problem:
>
> 1-I change with code the text of TextBox1 in TabPage 1
> (TextBox1.Text="Hello")
> 2-I click on TabPage 2.
> 3-I return to TabPage 1. Then, TextBox1 removes 'Hello' and puts the
> old
> value.
> 4-But If I change de Text of TextBox1 directly (not by code changing
> Text Property), It works fine.
>
> What can I do?
>
> Regards,
> Juanjo.
>
>
>