Can anybody see where this is failing?
Private Sub Button2_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button2.Click
da.SelectComman d.Parameters.Ad d("@CustomerID" ,
SqlDbType.VarCh ar, 40)
Dim ds As New DataSet
da.SelectComman d.Parameters("@ CustomerID").Va lue = myCustID
da.Fill(ds, "Customers" )
End Sub
The error that I am getting on the fill command is: "The variable name
'@CustomerID' has already been declared. Variable names must be unique
within a query batch or stored procedure."
The dataadapter being referenced (da) is on the form with a
selectcommand set up in the query builder as such:
SELECT OrderID, CustomerID, OrderDate, EmployeeID
FROM Orders
WHERE CustomerID = @CustomerID
I can't seem to pass this value into the query correctly. I've tried
taking the @ signs out of the code, but exact same error.
thanks, Ken
Private Sub Button2_Click(B yVal sender As Object, ByVal e As
System.EventArg s) Handles Button2.Click
da.SelectComman d.Parameters.Ad d("@CustomerID" ,
SqlDbType.VarCh ar, 40)
Dim ds As New DataSet
da.SelectComman d.Parameters("@ CustomerID").Va lue = myCustID
da.Fill(ds, "Customers" )
End Sub
The error that I am getting on the fill command is: "The variable name
'@CustomerID' has already been declared. Variable names must be unique
within a query batch or stored procedure."
The dataadapter being referenced (da) is on the form with a
selectcommand set up in the query builder as such:
SELECT OrderID, CustomerID, OrderDate, EmployeeID
FROM Orders
WHERE CustomerID = @CustomerID
I can't seem to pass this value into the query correctly. I've tried
taking the @ signs out of the code, but exact same error.
thanks, Ken
Comment