Search through data returned from stored procedure

C

CSINVA

I have a stored procedure that returns columns from a table called
UserProfile. Within the table, it has a column called ProfielD,
PropertyValue, Visitbility. I need to be able set the values returned
to a variable to be used later. Here is an example of the data
without filtering stored procedure:

ProfileID, UserID, PropertyDefinitation, PropertyValue,Visibiity
31, 3, 20, Prefix, 2
32, 3, 22, Suffix, 2
33, 3, 25, unit, 2
34, 3, 30, zip, 2
35, 4, 20, Prefix, 2
36, 4, 22, Suffix, 2
37, 4, 25, unit, 2

I created the stored procedure to take a @userID parameter so only the
rows with the appropriate userID would be displayed.

So now my data looks like when filtered with userID = 3

ProfileID, UserID, PropertyDefinitation, PropertyValue,Visibiity
31, 3, 20, Prefix, 2
32, 3, 22, Suffix, 2
33, 3, 25, unit, 2
34, 3, 30, zip, 2

Now I need to:

Assign the value in the PropertyValue column where it is equal to a
particual number in the PropertyDefinitation column, such as:

txtPrefix = Number 20 - Prefix
txtPrefixVisibility = Number 20 - Visibility
txtSuffix = Number 22 - Suffix
txtPrefixVisibility = Number 22 - Visibility
txtUnit = Number 25 - Unit
txtUnitVisibility = Number 25 - Visibility
txtZip = Number 30 - Zip
txtZipVisibiity = Number 30 - Visibility
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top