Binding TextBoxes?
My problem is that i will like to bind more textboxes from a 2 different tables. How i must then prepare my dataset?
Can you please help me?
My query statement is:
SELECT employe.name, location.country
FROM (employe INNER JOIN
location ON employe.ID_employe = location.ID_employe)
objDataAdapter.Fill(PocitniskeDataSet1)
Right?
My tables are "employe" and "location"!
Then how should my textbox look like?
textbox_name.DataBindings.Add(New Binding("text", PocitniskeDataSet1.employe, "employe.name"))
textbox_location.DataBindings.Add(New Binding("text", PocitniskeDataSet1.location, "location.country"))
But this way it don't works correctly? Can you guys please give me some right directions?
Thanks ;)
[840 byte] By [
nectuss] at [2007-11-19 20:17:29]

# 1 Re: Binding TextBoxes?
You should try it this way objDataAdapter.Fill(PocitniskeDataSet1, "myTable")
textbox_name.DataBindings.Add(New Binding("text", PocitniskeDataSet1.Tables[0], "employee.name"))
textbox_location.DataBindings.Add(New Binding("text", PocitniskeDataSet1.Tables[0], "location.country")) And it is always better to show what error you are getting.
# 2 Re: Binding TextBoxes?
You should try it this way objDataAdapter.Fill(PocitniskeDataSet1, "myTable")
textbox_name.DataBindings.Add(New Binding("text", PocitniskeDataSet1.Tables[0], "employee.name"))
textbox_location.DataBindings.Add(New Binding("text", PocitniskeDataSet1.Tables[0], "location.country")) And it is always better to show what error you are getting.
I have tryed your way Shuja Ali but i have got an exception: Child list for field employe cannot be created. What i'm doing wrong?