T
Topshot Systems
I must be missing something simple, but being new to .Net I wouldn't
be surprised. I'm using CF 2.0. I keep getting error 66 invalid syntax
near "mrs..." when the ExecuteNonQuery fires. I've tried "dbo." in
front of the sproc name also.
Using conSql As New SqlConnection(strConnString)
Using sqlUpdateOrder As New
SqlCommand("mrs_update_order", conSql)
sqlUpdateOrder.Parameters.AddWithValue("@char_user", strUsername)
sqlUpdateOrder.Parameters.AddWithValue("@char_order",
lstOrders.SelectedItem.ToString)
Try
conSql.Open()
Dim intCnt As Integer =
sqlUpdateOrder.ExecuteNonQuery()
If intCnt = 0 Then lblStatus.Text = "This
order was already accepted by someone else."
Catch errSql As SqlException
DisplaySQLErrors(errSql)
Finally
conSql.Close()
End Try
End Using
End Using
I had been using the actual SQL command (see sproc code below) that
was made with the above 2 parameter values, which worked just fine,
and then just started moving them to stored procedures. This was the
first one and I haven't had any success yet.
The sproc is very simple:
procedure [dbo].[mrs_update_order]
(
@char_user varchar(50),
@char_order varchar(815)
)
as
begin
UPDATE rawmaterial
SET status = 'A', acceptdate = getdate(), acceptedby = @char_user
WHERE status = 'O' AND orderdetail = @char_order
end
Do I HAVE to use an adapter when using parameters or something?
be surprised. I'm using CF 2.0. I keep getting error 66 invalid syntax
near "mrs..." when the ExecuteNonQuery fires. I've tried "dbo." in
front of the sproc name also.
Using conSql As New SqlConnection(strConnString)
Using sqlUpdateOrder As New
SqlCommand("mrs_update_order", conSql)
sqlUpdateOrder.Parameters.AddWithValue("@char_user", strUsername)
sqlUpdateOrder.Parameters.AddWithValue("@char_order",
lstOrders.SelectedItem.ToString)
Try
conSql.Open()
Dim intCnt As Integer =
sqlUpdateOrder.ExecuteNonQuery()
If intCnt = 0 Then lblStatus.Text = "This
order was already accepted by someone else."
Catch errSql As SqlException
DisplaySQLErrors(errSql)
Finally
conSql.Close()
End Try
End Using
End Using
I had been using the actual SQL command (see sproc code below) that
was made with the above 2 parameter values, which worked just fine,
and then just started moving them to stored procedures. This was the
first one and I haven't had any success yet.
The sproc is very simple:
procedure [dbo].[mrs_update_order]
(
@char_user varchar(50),
@char_order varchar(815)
)
as
begin
UPDATE rawmaterial
SET status = 'A', acceptdate = getdate(), acceptedby = @char_user
WHERE status = 'O' AND orderdetail = @char_order
end
Do I HAVE to use an adapter when using parameters or something?