473,395 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Datasource parameters

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
Nov 19 '05 #1
2 1367
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
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

Nov 19 '05 #2
Brock Allen wrote:
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
Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
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...
2
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...
2
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...
1
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...
6
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...
4
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<>,...
1
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...
0
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...
2
by: =?Utf-8?B?QnJldA==?= | last post by:
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.