[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Setting a string variable as a dataset field value

Posted on 2004-08-05
7
Medium Priority
?
322 Views
Last Modified: 2010-04-23
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?
0
Comment
Question by:originsone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 4

Expert Comment

by:jrandallsexton
ID: 11726995
Do you mean how do you get the values out of the dataset and put it into the variable?
0
 
LVL 18

Expert Comment

by:DotNetLover_Baan
ID: 11727255
The concept of "Data Binding" is ONLY for controls. In broader sense, Control is nothing but a variable.
0
 

Author Comment

by:originsone
ID: 11727462
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 4

Accepted Solution

by:
jrandallsexton earned 1200 total points
ID: 11727507
Do you simply want to iterate the dataset and get the values out?
If so ...

        Dim dr As DataRow
            For Each dr In myDataSet.Tables(0).Rows
                If (condition) Then
                    someVariable = dr.Item(0).ToString
                    someVariable2 = dr.Item(1).ToString
                End If
            Next
0
 
LVL 18

Assisted Solution

by:DotNetLover_Baan
DotNetLover_Baan earned 800 total points
ID: 11727544
originsone ,
this is not binding.... what you are thinking... this is just assigning a field value to a variable. "BINDING" is different, from just assigning a value.
0
 
LVL 4

Expert Comment

by:jrandallsexton
ID: 11727556
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.
0
 

Author Comment

by:originsone
ID: 11727756
Thanks! This is exactly the information i need. This is why I pay $10 a month.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question