How can i set the data source and data field to textboxes on VB.net???
in VB6 i used to do:
VB Code:
txt_user.DataSource = rs txt_user.DataField = user
Thank you,
Guilherme
Printable View
How can i set the data source and data field to textboxes on VB.net???
in VB6 i used to do:
VB Code:
txt_user.DataSource = rs txt_user.DataField = user
Thank you,
Guilherme
In .NET , I think it's similar to this .
VB Code:
TextBox1.DataBindings.Add(new Binding("bind",ds,"table")
Do not use binding. it sucks and will cause you headaches later.
I agree this time . But I tried to answer the guy whether I like or dislike binding .Do your work in code .Quote:
Originally posted by MikeStammer
Do not use binding. it sucks and will cause you headaches later.
that works using ADO.Net.
Anybody knows how to do that using ADODB????
Thanks,
Guilherme
if you say that binding is bad, what do you recommend???
use code or iterate the control you'd like with the data in the database or whatever .Quote:
Originally posted by gccosta
if you say that binding is bad, what do you recommend???
Dude , that's old-fashioned model . In .NET ADO.NET is super cool . Just give it a chance you won't regret it .Quote:
Originally posted by gccosta
that works using ADO.Net.
Anybody knows how to do that using ADODB????
Thanks,
Guilherme
i was thinking in doing this by code, but i´m afraid that it cen get a little slow!!
have a class that does all your data access and then returns another class that represents wha you are working on.
Then you change values of controls based on this object:
txtFoo.text = myObject.PropertyFoo
Then if someone changes txtFoo you do this:
myObject.PropertyFoo = txtFoo.text
and pass the object back to your data access class that takes the changes and persists them to the database.
Databinding is WAY slower than manually doing it. Thing of all the crap that has to be tracking doing it automagically by the run time vs you managing it via code.
Why how much data do you have ? a million record maybe ;) ?Quote:
Originally posted by gccosta
i was thinking in doing this by code, but i´m afraid that it cen get a little slow!!
i did by code, and it will spend some time to be slow, today i have only 750 registers on the DB!!
Thanks for your help!!