You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I do not know if I'm doing something wrong. The following is the error message when I use a parameter in an SQL query, Can you help me?
MY ENVIROMENT: Macintosh; Intel Mac OS X 10_12_6; Visual Studio For Mac; Asp.net Core 2.0
MY CODE:
...
OracleConnection con = null;
con = new OracleConnection(connectionString);
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = "SELECT * FROM PRODUTO WHERE ID = :ID";
OracleParameter myParameter1 = new OracleParameter("ID", OracleType.Number);
myParameter1.Value = 1;
myParameter1.Direction = ParameterDirection.Input;
cmd.Parameters.Add(myParameter1);
OracleDataReader reader = cmd.ExecuteReader();
Uh oh!
There was an error while loading. Please reload this page.
Hi, I do not know if I'm doing something wrong. The following is the error message when I use a parameter in an SQL query, Can you help me?
MY ENVIROMENT: Macintosh; Intel Mac OS X 10_12_6; Visual Studio For Mac; Asp.net Core 2.0
MY CODE:
...
OracleConnection con = null;
con = new OracleConnection(connectionString);
con.Open();
OracleCommand cmd = con.CreateCommand();
cmd.CommandType = CommandType.Text;
...
ERROR:
MarshalDirectiveException: Cannot marshal 'parameter #8': Unknown error.
System.Data.OracleClient.Oci.OciCalls+OciNativeCalls.OCIBindByNameBytes(IntPtr stmtp, out IntPtr bindpp, IntPtr errhp, string placeholder, int placeh_len, Byte[] valuep, int value_sz, OciDataType dty, IntPtr indp, IntPtr alenp, IntPtr rcodep, uint maxarr_len, IntPtr curelp, uint mode)
System.Data.OracleClient.Oci.OciCalls.OCIBindByNameBytes(IntPtr stmtp, out IntPtr bindpp, IntPtr errhp, string placeholder, int placeh_len, Byte[] valuep, int value_sz, OciDataType dty, IntPtr indp, IntPtr alenp, IntPtr rcodep, uint maxarr_len, IntPtr curelp, uint mode) in OciCalls.cs
+
return OciNativeCalls.OCIBindByNameBytes (stmtp, out bindpp, errhp, placeholder, placeh_len, valuep,
System.Data.OracleClient.OracleParameter.Bind(OciStatementHandle statement, OracleConnection con, uint pos) in OracleParameter.cs
+
status = OciCalls.OCIBindByNameBytes (statement,
System.Data.OracleClient.OracleCommand.BindParameters(OciStatementHandle statement) in OracleCommand.cs
+
Parameters[p].Bind (statement, Connection, (uint) p);
System.Data.OracleClient.OracleCommand.ExecuteReader(CommandBehavior behavior) in OracleCommand.cs
+
BindParameters (statement);
System.Data.OracleClient.OracleCommand.ExecuteReader() in OracleCommand.cs
+
return ExecuteReader (CommandBehavior.Default);
EstudoAspCore.Repositories.ProdutoRepository.GetByID(int pID) in ProdutoRepository.cs
+
OracleDataReader reader = cmd.ExecuteReader();
EstudoAspCore.Controllers.ProdutoController.Get(int id) in ProdutoController.cs
+
return produtoRepository.GetByID(id);
lambda_method(Closure , object , Object[] )
Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(object target, Object[] parameters)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+d__12.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+d__10.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Rethrow(ActionExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker+d__14.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__22.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Rethrow(ResourceExecutedContext context)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker.Next(ref State next, ref Scope scope, ref object state, ref bool isCompleted)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__17.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Mvc.Internal.ResourceInvoker+d__15.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Builder.RouterMiddleware+d__4.MoveNext()
System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware+d__7.MoveNext()
The text was updated successfully, but these errors were encountered: