Error "Must Declare Scalar Variable @ServerName"

Error "Must Declare Scalar Variable @ServerName"

am 25.01.2008 21:37:38 von mark

I am really struggling with this, trying to understand why it doesn't work.
I've simplified the code down to the essentials. The GridView displays in
ReadOnly mode just fine, Clicking the "edit" button in the gridview works
just fine, but clicking the "Delete" button gives the error "Must Declare
Scalar Variable @ServerName" yet the code in the UpdateCommand and
DeleteCommand are essentially the same!

I must be missing something basic but I just can't see it, can someone
please point it out?
Mark



<%@ page language="VB" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>


ConnectionString="<%$ ConnectionStrings:RWSqlConnectionString %>"
SelectCommand="SELECT * FROM SERVERINFO"
UpdateCommand="Update SERVERINFO SET
ServerName=@ServerName,
FacCode=@FacCode
WHERE ServerName=@ServerName"
DeleteCommand="DELETE From SERVERINFO
WHERE ServerName=@ServerName">


AutoGenerateColumns="False"
AutoGenerateEditButton="True"
AutoGenerateDeleteButton="True">







Re: Error "Must Declare Scalar Variable @ServerName"

am 28.01.2008 16:50:55 von mark

Does anyone have any ideas, its got to be something really basic, the delete
code is only one line long but it looks just fine to me.
Mark


"Mark" wrote in message
news:D8F8C2D5-1F44-4828-B325-E1635790CA2E@microsoft.com...
>I am really struggling with this, trying to understand why it doesn't work.
>I've simplified the code down to the essentials. The GridView displays in
>ReadOnly mode just fine, Clicking the "edit" button in the gridview works
>just fine, but clicking the "Delete" button gives the error "Must Declare
>Scalar Variable @ServerName" yet the code in the UpdateCommand and
>DeleteCommand are essentially the same!
>
> I must be missing something basic but I just can't see it, can someone
> please point it out?
> Mark
>
>
>
> <%@ page language="VB" %>
> <%@ Import Namespace="System.Data" %>
> <%@ Import Namespace="System.Data.SqlClient" %>
>
>
> > ConnectionString="<%$ ConnectionStrings:RWSqlConnectionString %>"
> SelectCommand="SELECT * FROM SERVERINFO"
> UpdateCommand="Update SERVERINFO SET
> ServerName=@ServerName,
> FacCode=@FacCode
> WHERE ServerName=@ServerName"
> DeleteCommand="DELETE From SERVERINFO
> WHERE ServerName=@ServerName">
>

>


> > AutoGenerateColumns="False"
> AutoGenerateEditButton="True"
> AutoGenerateDeleteButton="True">
>
>
>
>

>

>

>
>
>