Link to home
Start Free TrialLog in
Avatar of T Hoecherl
T HoecherlFlag for United States of America

asked on

Populate VB.net variables from SQL Select Query

I am calling this sql command from vb.net:

cmd.CommandText = "SELECT * FROM SNUGZ_EXT00101_SOP10200_2 WHERE PT_UD_KEY = '" & strKey & "'"
       
The sql query will return 1 row with several columns labeled PT_UD_1, PT_UD_2, etc.

I want to put the values in the columns into variables in my vb.net code.  For example:

strImprint = PT_UD_1
strImprintColor = PT_UD_2


How do I code my vb.net to do this?
Avatar of T Hoecherl
T Hoecherl
Flag of United States of America image

ASKER

Additional information:

I only want to run the SQL query once.  I don't want to run it each time for each of the 12 variables I need to populate.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

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
Did the trick.  Thanks.