473,569 Members | 3,015 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1478
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**@discussio ns.microsoft.co mwrote in message
news:7A******** *************** ***********@mic rosoft.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**@discussio ns.microsoft.co mwrote in message
news:7A******** *************** ***********@mic rosoft.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
1639
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 passing parameters to limit the results: One person develops the report layout using a view. The other person creates a datatable at runtime from a...
2
8188
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 times equivilant to the number of records returned, instead of the two columns(value and text) I have populated the datareader with. Any ideas?
2
1671
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 parameters to a stored procedure. I would like to update the datasource of the datagrid based on the results of the stored procedure. I have...
1
481
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 that I provide a server name, stored procedure name and it's parameters, and make crystal connect to the database itself. So I don't want to get the...
2
1378
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 parameter "surname" matches with the @surname parameter of the
6
1504
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 this parameter? it's not a form field, nor a session, but it's there. Any idea how i can get this? -- thanks (as always) some day i''m gona pay...
4
10114
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<>, both works. private void Form1_Load(object sender, EventArgs e) { System.Collections.SortedList QA1 = new System.Collections.SortedList();
1
2495
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 by a response.redirect object to open the page, or is there another way of supplying the query string to the datasource ? Any examples of C#...
0
1282
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 datasource parameters to show only todays information as a default. And when i enter dates into 2 textboxes, i want the page to postback, but use...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7681
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.