MAQ wrote:
Hi,
I have 2 ObjectDataSource on my page "OderDetailDataSource" and
"CustomerDataSource".
The first datasource returns only one record, out of which there one column
called "CustomerID". The value on this column should be passed as
SelectParamter "CustomerID" for CustomerDataSource.
Could anybody help me figuring out how to do this? It might be something
very simple, but i'm still quite new to .NET.
Thanks in advance
/MAQ
I don't know where could you need get value of "customerId" ? So i
assume that you store customerId in a HiddenField, so here your code :
[Code design]
<asp:ObjectDataSource ID="CustomerDataSource" TypeName="CustomerSource"
SelectMethod="GetCustomer" runat="server">
<SelectParameters>
<asp:ControlParameter ControlID="hiddenFieldCustomerId"
Name="customerId" PropertyName="Value" Type="int32" />
</SelectParameters></asp:ObjectDataSource>
[App_Code]
public class CustomerDataSource {
// ...
public IList<CustomerGetCustomer(int customerId) {
// your code in here to get one customer with id is "customerId"
// ...
}
// ...
}
--
Duy Lam Phuong