|
-
Oct 2nd, 2003, 07:52 AM
#1
Thread Starter
Addicted Member
Data Source and Field - Solved (Not with data source)
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
Last edited by gccosta; Oct 2nd, 2003 at 09:04 AM.
-
Oct 2nd, 2003, 08:07 AM
#2
Sleep mode
In .NET , I think it's similar to this .
VB Code:
TextBox1.DataBindings.Add(new Binding("bind",ds,"table")
-
Oct 2nd, 2003, 08:25 AM
#3
Lively Member
Do not use binding. it sucks and will cause you headaches later.
-
Oct 2nd, 2003, 08:28 AM
#4
Sleep mode
Originally posted by MikeStammer
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 .
-
Oct 2nd, 2003, 08:28 AM
#5
Thread Starter
Addicted Member
that works using ADO.Net.
Anybody knows how to do that using ADODB????
Thanks,
Guilherme
-
Oct 2nd, 2003, 08:29 AM
#6
Thread Starter
Addicted Member
if you say that binding is bad, what do you recommend???
-
Oct 2nd, 2003, 08:31 AM
#7
Sleep mode
Originally posted by gccosta
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 .
-
Oct 2nd, 2003, 08:33 AM
#8
Sleep mode
Originally posted by gccosta
that works using ADO.Net.
Anybody knows how to do that using ADODB????
Thanks,
Guilherme
Dude , that's old-fashioned model . In .NET ADO.NET is super cool . Just give it a chance you won't regret it .
-
Oct 2nd, 2003, 08:33 AM
#9
Thread Starter
Addicted Member
i was thinking in doing this by code, but i´m afraid that it cen get a little slow!!
-
Oct 2nd, 2003, 08:33 AM
#10
Lively Member
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.
-
Oct 2nd, 2003, 08:35 AM
#11
Sleep mode
Originally posted by gccosta
i was thinking in doing this by code, but i´m afraid that it cen get a little slow!!
Why how much data do you have ? a million record maybe ?
-
Oct 2nd, 2003, 09:04 AM
#12
Thread Starter
Addicted Member
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!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|