R
RichardF
Not sure if ths is the right place, but I couldn't find a group for
asp.net 2.0 beta.
I am having a problem with updating databases using the data grid. I
have the following code...
<asp:SqlDataSource ID="SqlDataSource1" Runat="server"
SelectCommand="Select * From Customers"
UpdateCommand="UPDATE Customers SET CompanyName =
@CompanyName, Country = @Country, Region = @Region WHERE (CustomerID =
@CustomerID)"
DeleteCommand="DELETE FROM Customers WHERE (CustomerID =
@CustomerID)"
ConnectionString="Server=(local);Trusted_Connection=True;Integrated
Security=SSPI;Persist Security Info=True;Database=Northwind"
ProviderName="System.Data.SqlClient">
<UpdateParameters>
<asparameter Name="CustomerID" Type="String" />
<asparameter Name="CompanyName" Type="String" />
<asparameter Name="Country" Type="String" />
<asparameter Name="Region" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asparameter Name="CustomerID" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
After clicking edit, making a change and then clicking update I get
the error...
Must declare the variable '@CustomerID'.
(Same happens when I try to Delete as well)
Any ideas?
RichardF
asp.net 2.0 beta.
I am having a problem with updating databases using the data grid. I
have the following code...
<asp:SqlDataSource ID="SqlDataSource1" Runat="server"
SelectCommand="Select * From Customers"
UpdateCommand="UPDATE Customers SET CompanyName =
@CompanyName, Country = @Country, Region = @Region WHERE (CustomerID =
@CustomerID)"
DeleteCommand="DELETE FROM Customers WHERE (CustomerID =
@CustomerID)"
ConnectionString="Server=(local);Trusted_Connection=True;Integrated
Security=SSPI;Persist Security Info=True;Database=Northwind"
ProviderName="System.Data.SqlClient">
<UpdateParameters>
<asparameter Name="CustomerID" Type="String" />
<asparameter Name="CompanyName" Type="String" />
<asparameter Name="Country" Type="String" />
<asparameter Name="Region" Type="String" />
</UpdateParameters>
<DeleteParameters>
<asparameter Name="CustomerID" Type="String" />
</DeleteParameters>
</asp:SqlDataSource>
After clicking edit, making a change and then clicking update I get
the error...
Must declare the variable '@CustomerID'.
(Same happens when I try to Delete as well)
Any ideas?
RichardF