Home All Groups Group Topic Archive Search About
Author
12 Jul 2006 10:02 PM
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!

Author
13 Jul 2006 7:42 AM
Riki
TJHerman wrote:
> 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>

--

Riki
Author
13 Jul 2006 10:50 AM
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.

Show quoteHide quote
"Riki" wrote:

> TJHerman wrote:
> > 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>
>
> --
>
> Riki
>
>
>