Datasource parameters

  • Thread starter Thread starter Not Me
  • Start date Start date
N

Not Me

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
stored procedure used in the datasource. If I change the name, then I
get an error as the alternative name won't match with the stored
procedure parameter.

The parameter value will come from a detailsview control

<asp:BoundField DataField="surname" HeaderText="surname"
SortExpression="surname" />

I assume this is works together because 'datafield' value matches 'name'
in the parameter declaration.

The problem I have is, when I have a datafield called 'email address',
and a parameter in my stored procedure called 'email'. How can I alter
the parameter to fetch data from 'email address' datafield, but pass it
on as 'email' to the stored procedure?

Any tips much appreciated!!
Cheers,
Chris
 
The way the data source controls (DSC) "communicate" with the data bound
controls (DBC) is via a dictionary. So when there's an update the DBC needs
to pass a dictionary of key/value pairs to the DSC. How does the DBC know
what key values are important? Because it uses the keys returned from the
select statement of the DSC. So, IOW, the keys returnes from the DSC's select
have to be the same set of keys passed into the DSC's update method.

-Brock
DevelopMentor
http://staff.develop.com/ballen
 
Brock said:
The way the data source controls (DSC) "communicate" with the data bound
controls (DBC) is via a dictionary. So when there's an update the DBC
needs to pass a dictionary of key/value pairs to the DSC. How does the
DBC know what key values are important? Because it uses the keys
returned from the select statement of the DSC. So, IOW, the keys
returnes from the DSC's select have to be the same set of keys passed
into the DSC's update method.


Thanks for that :)

Chris
 
Back
Top