473,396 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Search through data returned from stored procedure

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

Nov 2 '07 #1
1 1052
Have your data returned to a DataTable. Then you can use DataTable.Select
method to locate required rows.

--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"CSINVA" <mc*************@yahoo.comwrote in message
news:11*********************@z9g2000hsf.googlegrou ps.com...
>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

Nov 4 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: todd | last post by:
here is a search tool SP I wrote. How many times have you wanted to search all your Stored procs or views (in a database) for a keyword but couldn't!? Well now you can! THis can makes life a...
3
by: Job Lot | last post by:
My DataGrid is bound to DataSet which contains relationship between two tables as follows: SqlHelper.FillDataset(strConn, CommandType.StoredProcedure, "spSelectClientApplicant", ds, New String()...
2
by: M Wells | last post by:
Hi All, I'm trying to track down a mysterious problem we're experiencing in which updates and inserts to tables in our mssql2k server appear to be 'disappearing.' To explain our situation: ...
4
by: Axel | last post by:
Is it possible to write a Stored Procedure that takes a string of search keywords as argument and returns the recordset? At the mo I am passing the WHERE String as argument. I got this...
2
by: serge | last post by:
My project is to automate testing of Stored Procedures of type SELECT (at least for now). I want to create a table where each stored procedure's input parameter values are entered and in another...
5
by: Raquel | last post by:
This is a very simple DB2 SQLJ stored procedure. The problem is that it seems to run fine but returns NOTHING. I mean..as if nothing has happened..not resultset is returned. I am passing value...
2
by: Josh Strickland | last post by:
I am attempting to create an Access database which uses forms to enter data. The issue I am having is returning the query results from the Stored Procedure back in to the Access Form. ...
1
by: Jim Heavey | last post by:
I have a SQL stored procedures which evaluate the values passed in parameters and then based on those values reads the appropriate records. I run the stored procedure in VS 2005 Debug mode and it...
4
by: red vertigo | last post by:
HI All, Can't quite get my head aorund this problem. My knowledge or more importantly my experience of using T-SQL is small and as a consequence my stored procedures are basic. My current...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.