473,394 Members | 1,932 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,394 software developers and data experts.

SQL DataSource parameters

I am a VB and SQL developer but new to ASP.Net world.
I have a SQL Datasource that returns an ID of the Current user.
I've setup a second SQL Datasource that performs a SELECT statement to a
table but now need to use the WHERE criteria to capture the ID from the 1st
datasource mentioned above to query the results for the current user. Please
what is the best way or ways to accomplish this? I know I need a parameter
that is bound to a control in the form but dont know how to do this.
Also I would also like to know how to create a FUNCTION in SOURCE code that
captures the ID from the first SQL DataSource. thanks for any assistance.
Feb 28 '07 #1
2 1473
It all depends on where you're storing your ID - - if you have it visible,
using a control, or have it assigned to a session, etc.
As you go through the sql wizard (vs.net 2005) in configuring the
datasource, you assign the parameters, then, at that point, you choose where
the parameter is getting its data.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Bret" <Br**@discussions.microsoft.comwrote in message
news:7A**********************************@microsof t.com...
I am a VB and SQL developer but new to ASP.Net world.
I have a SQL Datasource that returns an ID of the Current user.
I've setup a second SQL Datasource that performs a SELECT statement to a
table but now need to use the WHERE criteria to capture the ID from the
1st
datasource mentioned above to query the results for the current user.
Please
what is the best way or ways to accomplish this? I know I need a
parameter
that is bound to a control in the form but dont know how to do this.
Also I would also like to know how to create a FUNCTION in SOURCE code
that
captures the ID from the first SQL DataSource. thanks for any assistance.

Feb 28 '07 #2
thanks for your reply David.
Okay, I would like to store the the ID in a label or text box then, how do I
display the ID results in these controls?

"David Wier" wrote:
It all depends on where you're storing your ID - - if you have it visible,
using a control, or have it assigned to a session, etc.
As you go through the sql wizard (vs.net 2005) in configuring the
datasource, you assign the parameters, then, at that point, you choose where
the parameter is getting its data.

--
David Wier
MVP/ASPInsider
http://aspnet101.com
http://aspexpress.com
"Bret" <Br**@discussions.microsoft.comwrote in message
news:7A**********************************@microsof t.com...
I am a VB and SQL developer but new to ASP.Net world.
I have a SQL Datasource that returns an ID of the Current user.
I've setup a second SQL Datasource that performs a SELECT statement to a
table but now need to use the WHERE criteria to capture the ID from the
1st
datasource mentioned above to query the results for the current user.
Please
what is the best way or ways to accomplish this? I know I need a
parameter
that is bound to a control in the form but dont know how to do this.
Also I would also like to know how to create a FUNCTION in SOURCE code
that
captures the ID from the first SQL DataSource. thanks for any assistance.


Feb 28 '07 #3

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

Similar topics

0
by: Slonjo | last post by:
I don't know if this has been addressed in some other form/forum but we tried what we thought was everything. I apologize if i'm being redundant. We build reports like so when they require...
2
by: Jake S | last post by:
Hi all, Is it possibele to set the datasource of a dropdown list to a datareader? When I try to the only column I receive is a column populated by the datasource name repeated the amount of...
2
by: Mo | last post by:
Hi, I have a page that is split into two frames: top and bottom. The top page is a search parameters page and the bottom is the results page; which holds the datagrid. The search page sends the...
1
by: Versteijn | last post by:
Hello all I want to define a crystal report and assign the stored procedure GetOpenQuestions() as it's datasource and provide a set of parameters. How does this work? My target situation is...
2
by: Not Me | last post by:
Hi, I'm a little confused with working with parameters for a datasource - specifically when it comes to naming them. For example <asp:parameter Name="surname" type="String" /> this...
6
by: WebBuilder451 | last post by:
I have a drop down list of saved searches for a user and i'm trying to use the datasource control to populate the ddl. The select value in the storedproc is the user.Identity.name. How can i use...
4
by: SHEBERT | last post by:
Here is an example of a SortedList that works as a datasource to the ComboBox and a generic SortedList<that does not works as a datasource to the ComboBox. Why? If I use List and generic List<>,...
1
by: Jim McGivney | last post by:
When configuring a DataSource for a control in VS'05, when formulating the WHERE clause, one of the options is to use a Query String to supply the parameters. Is this the Query String that is used...
0
by: johnnyD | last post by:
I am creating a page which displays a customers billing history. As such it uses a datasource which queries the billing table. This works fine, and outputs desired information I need. I need the...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.