populating textbox manually

Home built / N/A
November 17, 2010 at 02:40:20
Specs: Windows XP SP3, Intel Pentium 4 3Ghz 2GB RAM
Ok, i have a sql database in my vb2010 express app, and it has 5 tables.

On my form i have added a combobox and a textbox (multiline).
On the right of my form i have added 5 radio controls so i can choose which table i want to view/edit.

I have successfully managed to bind the combobox with which ever table i choose:
ComboBox2.DataSource = TableNameBindingSource
ComboBox2.DisplayMember = DataSetName.TableName.ColumnName.ToString

...the problem i have encountered is trying to populate the textbox in the same way. I need to bind the text property to a column in the table i choose.

The above code is added under each radiobutton_checkchanged event, with the table names being different in each.

I tried googling and found this:

TextBox1.DataBindings.Add("text", TableNameBindingSource, "ColumName")

...but this produces and error as the compiler says i am trying to bind to the textbox twice, but i can't figure out how!

Am i going about this all wrong, or am i just doing something wrong?

Any help much appreciated!


See More: populating textbox manually

Report •

November 18, 2010 at 06:57:45

Cleared the textbox before re-binding to the next table.

Where is everyone....???????


Report •
Related Solutions

Ask Question