12 Maret 2012 17:42
When I try to issue the Update command with these lines of code I get a SCALAR error on @Rowno and/or @Flagno. When I replace the @Rowno and @Flagno with a numeric number. I get no error.
How can I simplely update a single row with parms that change?
Dim cmd As New SqlCommand
Dim Reader As Integer
Dim Conn As New SqlConnection("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
Dim @Rowno As Integer = Convert.ToInt32(TextBox53.Text)
Dim @Flagno As Integer = Convert.ToInt32(TextBox54.Text)
cmd.CommandType = CommandType.Text
cmd.CommandText = "UPDATE [dbo].[Healing] SET [Printed] = @Printed WHERE (([Row] = @Rowno) AND ([Flag] = @Flagno))"
cmd.Connection = Conn
ReturnA = cmd.ExecuteNonQuery()
13 Maret 2012 8:51
This forum is not for ASP as that is not a part of VB Express, so if you have this kind of questions, don't write that, it adds nothing.
However, show us your screen so we can look what the error is, with the information error you have 100% more information than us so help is not so clever.
Do you have a blue or a red screen?
However, remove those tow Dims around @ and add this code.
cmd.Parameters.AddWithValue("@Rowno",Convert.ToInt32(TextBox53.Text)) cmd.Parameters.AddWithValue("@Flagno",Convert.ToInt32(TextBox54.Text)) 'as last before the update to make it readable
Be aware there can be typos as I did it in this message.