Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old December 5th, 2006, 03:56 PM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default sqldatasource parameter and databinding help

Hello:

I have come to a tricky part of my webproject. This maybe a bit confusing.

As of now I have two sqldatasources:

Code:
<asp:SqlDataSource ID="sqlBrokersAgentsRecips" runat="server" ConnectionString="<%$ AppSettings:connectionstring %>" ProviderName="System.Data.SqlClient" SelectCommandType="StoredProcedure" SelectCommand="callcenterdev..spGetBrokersAgentsForRecips">
    <SelectParameters>
        <asp:Parameter Name="OfficeId" DefaultValue="88430760" />
    </SelectParameters>
</asp:SqlDataSource>

<asp:SqlDataSource  ID="sqlMembersOfficeId" runat="server" ConnectionString="<%$ AppSettings:connectionstring %>" ProviderName="System.Data.SqlClient" SelectCommandType="Text" SelectCommand="SELECT m.Office_Number FROM rapdata..Member m WITH(NOLOCK) WHERE Member_Number = @sesBrokerId">
    <SelectParameters>
        <asp:SessionParameter SessionField="sesBrokerId" Name="sesBrokerId" />
    </SelectParameters>
</asp:SqlDataSource>
The sqlMembersOfficeId retrieves the office_number I need correctly, (I know because I have checked the db value and have outputted the value on a label control).

Now the tricky part I am trying to understand is, I need the office_id to be passed for the sqlBrokersAgentsRecips (as you can see I just manually add the value for now to test). Upon doing so I will be able to bind a dropdownlist with the correct members within the office_number.

Code:
<asp:DropDownList ID="BrokerAgentNamesDD" runat="server" DataSourceID="sqlBrokersAgentsRecips" DataTextField="Agent_Name" DataValueField="Member_Number">
</asp:DropDownList>
I know in asp 3.0 you could just sub out all your stored procedures and call them anytime, but looks like its much more elaborate in .NET.

Thanks for your help!
Reply With Quote
  #2 (permalink)  
Old December 5th, 2006, 05:23 PM
Authorized User
 
Join Date: Dec 2006
Location: , , .
Posts: 30
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I was doing some reading and it looks like I may need to use SqlDataSourceStatusEventArgs for add the output to a control, variable, ect?

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SQLDatasource cymerman ASP.NET 1.0 and 1.1 Basics 1 February 28th, 2008 12:38 AM
sqldatasource imjayakumar Crystal Reports 0 May 19th, 2007 03:12 AM
sqldatasource imjayakumar ASP.NET 2.0 Professional 0 May 19th, 2007 02:58 AM
SqlDataSource Input parameter sg225551 ASP.NET 2.0 Basics 0 January 16th, 2007 10:54 AM



All times are GMT -4. The time now is 12:58 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.