Click here to Skip to main content
16,016,814 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
myCommand = New OleDbCommand("Insert_User1", myConnection)
myCommand.CommandType = CommandType.StoredProcedure
myCommand.Parameters.AddWithValue("@TMPVAR", "1")
myCommand.Parameters.AddWithValue("@USER_ID", "2")
myCommand.Parameters.AddWithValue("@USER_NAME", "Your Name")
myCommand.Parameters.AddWithValue("@USER_ADDRESS", "Your Add")
myCommand.Parameters.AddWithValue("@USER_MOBILE", "55656566")

Can i using this code without put Parameter Name (@ParameterName) and Parameter Type (OracleDbType.ParameterType)
just , i want to send the values to Stored Procedure
Posted
Updated 6-Mar-12 22:05pm
v2

1 solution

First things first, you don't use the @ symbol with Oracle parameters. Replace it with a : instead to get the parameter correct. Secondly, rather than using OleDB, you should consider using ODP.NET - this is Oracle's Data Provider for .NET and is a much better choice for directly working with Oracle.

If you switch over to ODP.NET, you can also bind your parameters by position rather than by name. Simply set BindByName=False.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900