Can not retrieve text value of bound textbox

G

Guest

This seems like such a simple task. I have a textbox that is bound to a
database field, the text box displays the expected value but in my code when
I try to evaluate the text (ex. If txtSecurityGroup.Text = "purchasing") the
text property is = "". I am sure I am missing something here.
Help please, Thanks!
 
G

Guest

I should add that the textbox is bound by setting the databindings text
property to the database field.
 
G

Guest

I am not sure what the problem was, I simply deleted and recreated the
textbox and it is working just fine. The only difference is the textbox
appears on a different tab on the tabcontrol.???? Very frustrating.
 
G

Guest

This is now become a bigger problem for me now as I have other tabpages that
I want to bind to other fields in a database. I tested what I believed to be
happening in a simple program that has two tabpages on a tabcontrol. Each
tabpage contains a textbox that is bound to the exact same field in a
database. While running the debugger I hover over each of the textbox values
in the code and textbox1.text on tabpage1 contains the expected value but
textbox2.text on tabpage2 contains "". From a display standpoint when
viewing the forms both textboxes display the expected value. Is this some
sort of bug?

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Handles MyBase.Load
SqlDataAdapter1.Fill(DataSet11)

Dim test1 = TextBox1.Text
Dim test2 = TextBox2.Text
End Sub
 

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