S
Shelly
I get an error that the input string is not in the right format. Here is
the result:
Here is the partial code:
Dim sqlConn As New SqlConnection(SqlDataSource1.ConnectionString)
Dim query As String = "SELECT * FROM Agent WHERE accountNumber="
query += "@accountNumber AND agentID=@agentID AND authCode=@authCode"
Dim sqlComm As New SqlCommand(query, sqlConn)
sqlComm.Parameters.Add("@accountNumber", SqlDbType.Int).Value =
accountNumber.Text
sqlComm.Parameters.Add("@agentID", SqlDbType.Int).Value = agentID.Text
sqlComm.Parameters.Add("@authCode", SqlDbType.NChar).Value =
authCode.Text
Here is what sql.Comm has:
SELECT * FROM Agent WHERE accountNumber=@accountNumber AND
agentID=@agentID AND authCode=@authCode
Isn't the .Add supposed to replace the @ stuff witht he values?
I had been using StringBuilder to create the query text, but this looked so
much neater. What is wrong?
Shelly
the result:
Here is the partial code:
Dim sqlConn As New SqlConnection(SqlDataSource1.ConnectionString)
Dim query As String = "SELECT * FROM Agent WHERE accountNumber="
query += "@accountNumber AND agentID=@agentID AND authCode=@authCode"
Dim sqlComm As New SqlCommand(query, sqlConn)
sqlComm.Parameters.Add("@accountNumber", SqlDbType.Int).Value =
accountNumber.Text
sqlComm.Parameters.Add("@agentID", SqlDbType.Int).Value = agentID.Text
sqlComm.Parameters.Add("@authCode", SqlDbType.NChar).Value =
authCode.Text
Here is what sql.Comm has:
SELECT * FROM Agent WHERE accountNumber=@accountNumber AND
agentID=@agentID AND authCode=@authCode
Isn't the .Add supposed to replace the @ stuff witht he values?
I had been using StringBuilder to create the query text, but this looked so
much neater. What is wrong?
Shelly