Not sure if I understand.
For the dropdownlist, to bind it with a datasource, code is as follows:
<asp:DropDownLi st ID="DropDownLis t4" runat="server"
DataSourceID="O bjectDataSource 4" Enabled="False" DataTextField=" BoundName"
DataValueField= "BoundID" AppendDataBound Items="True" AutoPostBack="T rue"
OnDataBinding=" DropDownList4_D ataBinding"
OnSelectedIndex Changed="DropDo wnList4_Selecte dIndexChanged">
</asp:DropDownLis t>
<asp:ObjectData Source ID="ObjectDataS ource4" runat="server"
OldValuesParame terFormatString ="original_{ 0}"
SelectMethod="G etBounds"
TypeName="odsTa bleAdapters.tb_ BoundsTableAdap ter">
<SelectParamete rs>
<asp:ControlPar ameter ControlID="Drop DownList3"
Name="CommuneID " PropertyName="S electedValue"
Type="Object" />
<asp:Paramete r Name="ValidFrom " Type="DateTime" />
<asp:Paramete r Name="ValidTo" Type="DateTime" />
</SelectParameter s>
</asp:ObjectDataS ource>
I wrote a stored procedure that takes to parameres (@BoundID and
@BoundIdentifie r) and based on the @BoundID makes some computation.
All I want to do (but have absolutely no clue how) is when user makes a
selection in the drop down list, take the ID of the selected value, pass it
to the stored procedure, retreive the computed value (yes, by "always 13
chars" I meant it is char(13) datatype) and place it as a text property of a
label.
I assume the code responsible for that must be placed in a
SelectedIndexCh anged property of the DropDownList4 control.
"Cowboy (Gregory A. Beamer)" <No************ @comcast.netNoS pamMwrote in
message news:A5******** *************** ***********@mic rosoft.com...
The binding part is simple:
Label1.Text = ParamBoundIdent ifier.Value;
To work through this, you will have to create a data access routine with
two parameters.
1. Input parameter @BoundID
2. Output parameter @BoundIdentifie r
Not sure what the "always 13 chars" means, unless you are telling me the
field, in the database, is char(13), which really means very little to me.
--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA
Subscribe to my blog
http://gregorybeamer.spaces.live.com/lists/feed.rss
or just read it:
http://gregorybeamer.spaces.live.com/
*************** *************** **************
| Think outside the box! |
*************** *************** **************
"Igor" <ig***@live.com wrote in message
news:8B******** *************** ***********@mic rosoft.com...
>Hi
I build a page that has a dropdownlist control bound with data from a
database. When user select an item from the dropdownlist I want a label
to be filled with a result from a stored procedure. The stored procedure
takes an ID of a selected item (@BoundID) from the dropdownlist and gives
a result (@BoundIdentifi er) as follows:
---
Running [dbo].[tbh_GetBoundIde ntifier] ( @BoundID =
cf44452b-8b05-45da-a7c6-14146fba0356, @BoundIdentifie r = <NULL).
No rows affected.
(0 row(s) returned)
@BoundIdentifi er = 160302_R.0582
@RETURN_VALU E = 0
Finished running [dbo].[tbh_GetBoundIde ntifier].
---
The BoundIdentifier is always 13 char long.
How can I do that? I can't find any 'binding' for a label.
I'm new to ASP.NET.