Link to home
Start Free TrialLog in
Avatar of originsone
originsone

asked on

Setting a string variable as a dataset field value

How do I assign a string variable to a dataset field value. I am attaching to a SQL server, so I am using a SQLConnection, SQLDataAdapter, and a DataSet. Currently I am having to bind the field to a hidden text box. I really do not like this. Any ideas?
Avatar of jrandallsexton
jrandallsexton

Do you mean how do you get the values out of the dataset and put it into the variable?
The concept of "Data Binding" is ONLY for controls. In broader sense, Control is nothing but a variable.
Avatar of originsone

ASKER

Yes jrandallsexton. A variable that is a string.

DotNetLover  Has this changed since VB6? I thought you could assign data to a variable in 6. something like this.

Dim a as String
a = rsConnection!field

Please correct me if I am wrong.
ASKER CERTIFIED SOLUTION
Avatar of jrandallsexton
jrandallsexton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Baan is correct.  That is not binding - neither is what I did.

I simply am assigning the values from the dataset to whatever variables you need.
Thanks! This is exactly the information i need. This is why I pay $10 a month.