Runtime control binding problem

S

Steven Licciardi

I am creating a bunch of textboxes at runtime, like this:

''create, add and databind the textboxes
tb = New TextBox
tb.Size = New Size(200, 15)
tb.Name = r("ColumnName")
tb.Location = New Point(20 + lb.Width, cCount * 19 + 10)
tb.Anchor = AnchorStyles.Top Or AnchorStyles.Left Or AnchorStyles.Right
tb.BorderStyle = BorderStyle.FixedSingle
tb.DataBindings.Add("Text", dbo.Table, r("ColumnName"))
Me.Controls.Add(tb)

This seems to work fine and populates my form with textboxes and fills my
textboxes with data from the database. My problem is that when I change any
of the data in the textbox, then try to update the database I find that the
underlying DataTable has no changes i.e. dbo.Table.GetChanges() returns
nothing, despite the fact I know I have just changed the contents of a
databound textbox. Any ideas?

Thanks,

Steven
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top