Public Function executeUpdateQuery(ByVal _query As [String], ByVal OleDbParameter As OleDbParameter()) As Boolean Dim myCommand As New OleDbCommand() Try myCommand.Connection = openConnection() myCommand.CommandText = _query myCommand.Parameters.AddRange(OleDbParameter) myAdapter.UpdateCommand = myCommand myCommand.ExecuteNonQuery() Catch e As SqlException MsgBox("Error - Connection.executeUpdateQuery - Query: " & _query & " " & vbLf & "Exception: " & e.StackTrace.ToString()) Return False End Try Return True End Function
Replace my named parameters with "?" for example: SELECT COUNT(*) FROM Account WHERE AccountID = ?
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)