@ Parameter Question

T

TJHerman

I'm trying to understand where a SQLDataSource control gets the value for the
@ parameter that it passes to its sql action queries.

I have a page where the insert and update work just fine and find a
"@CompanyID" value to use on the sql statements but when I try to do a
delete, I get an error page with the message:

Exception Details: System.Data.SqlClient.SqlException: Must declare the
variable '@CompanyID'.

Can anyone tell me where this value comes from and/or what I should be
looking for to fix my problem?

Thanks very much!
 
R

Riki

TJHerman said:
I'm trying to understand where a SQLDataSource control gets the value
for the @ parameter that it passes to its sql action queries.

I have a page where the insert and update work just fine and find a
"@CompanyID" value to use on the sql statements but when I try to do a
delete, I get an error page with the message:

Exception Details: System.Data.SqlClient.SqlException: Must declare
the variable '@CompanyID'.

Can anyone tell me where this value comes from and/or what I should be
looking for to fix my problem?

It should be under <DeleteParameters>
 
T

TJHerman

Thanks very much for your response. It actually turned out to be that somehow
I didn't have a Datakeyname value defined on my formview.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top