Sub UpdateDBdata(ByVal docID As String, ByVal Revision As String)
Try
Dim connection As New SqlConnection("Server=it; Initial Catalog=qs; User ID=sa; pwd=sqldata")
Dim command As New SqlCommand("UpdateRev", connection)
command.CommandType = CommandType.StoredProcedure
Dim param_Revision As SqlParameter
param_Revision = command.Parameters.Add("@Rev_n", SqlDbType.Char, 6)
param_Revision.Value = "REVVV"
Dim param_ID As SqlParameter
param_ID = command.Parameters.Add("@DocID", SqlDbType.Int)
param_ID.Value = docID
connection.Open()
command.ExecuteNonQuery()
connection.Close()
Catch ex As Exception
checkError.Text = ex.ToString()
checkError.Visible = True
End Try
End Sub
The Debugger shows error:
System.FormatException: Input string was not in a correct format. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Test.Grid.UpdateDBdata(String docID, String Revision) in C:\Inetpub\wwwroot\Test\Grid.aspx.vb:line 140
Try
Dim connection As New SqlConnection("Server=it; Initial Catalog=qs; User ID=sa; pwd=sqldata")
Dim command As New SqlCommand("UpdateRev", connection)
command.CommandType = CommandType.StoredProcedure
Dim param_Revision As SqlParameter
param_Revision = command.Parameters.Add("@Rev_n", SqlDbType.Char, 6)
param_Revision.Value = "REVVV"
Dim param_ID As SqlParameter
param_ID = command.Parameters.Add("@DocID", SqlDbType.Int)
param_ID.Value = docID
connection.Open()
command.ExecuteNonQuery()
connection.Close()
Catch ex As Exception
checkError.Text = ex.ToString()
checkError.Visible = True
End Try
End Sub
The Debugger shows error:
System.FormatException: Input string was not in a correct format. at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Test.Grid.UpdateDBdata(String docID, String Revision) in C:\Inetpub\wwwroot\Test\Grid.aspx.vb:line 140