K
Ken
Can anybody see where this is failing?
Private Sub Button2_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
da.SelectCommand.Parameters.Add("@CustomerID",
SqlDbType.VarChar, 40)
Dim ds As New DataSet
da.SelectCommand.Parameters("@CustomerID").Value = 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(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Button2.Click
da.SelectCommand.Parameters.Add("@CustomerID",
SqlDbType.VarChar, 40)
Dim ds As New DataSet
da.SelectCommand.Parameters("@CustomerID").Value = 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