Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 18, 2012 04:41 AM by Decker Dong - MSFT
Participant
1596 Points
378 Posts
Feb 16, 2012 09:20 AM|LINK
Hi Friends.
I have a package in my Oracle database having procedures insertToEmp(), DeleteFromEmp() etc. I want to call these procedures from C#. Is it Possible to call a stored procedure of a package in oracle form my C# & ASP.NET application???
Member
355 Points
90 Posts
Feb 16, 2012 09:34 AM|LINK
Ofcourse it is possible/ you should use the connection and the command types of Oracle exactly as you use it in sql.
OracleCommand for commands and OracleParameter and OracleConnection....
Just add on the top of the file: using Syste.Data.OracleClient;
Hope I helped...
Feb 16, 2012 09:52 AM|LINK
Thanks.
But as I know while calling to a stored procedure :
command.CommandText="StoredProcedureName"
//we adds parameters to above procedur.
But I want to know how to call a procdure from a package that is stored in oracle database. Kindly help me be delivering some lines of code.
Thanks again .
1139 Points
237 Posts
Feb 16, 2012 10:09 AM|LINK
Packages and storeprocedure are same thing just calling package like this "SAS_SYS_PROC.PKG_ALERTS.INS_ALERTS"
All-Star
118619 Points
18779 Posts
Feb 18, 2012 04:41 AM|LINK
Hello mishra:)
Addition——Don't forget to add cmd.CommandType=CommandType.StoredProcedure before executing ExecuteNonQuery() or do query things。
For more you can see the sample:http://www.c-sharpcorner.com/UploadFile/john_charles/CallingOraclestoredproceduresfromMicrosoftdotNET06222007142805PM/CallingOraclestoredproceduresfromMicrosoftdotNET.aspx(See Part6)
mishra.bhupe...
Participant
1596 Points
378 Posts
Calling a procedure from oracle package.
Feb 16, 2012 09:20 AM|LINK
Hi Friends.
I have a package in my Oracle database having procedures insertToEmp(), DeleteFromEmp() etc. I want to call these procedures from C#. Is it Possible to call a stored procedure of a package in oracle form my C# & ASP.NET application???
duzi
Member
355 Points
90 Posts
Re: Calling a procedure from oracle package.
Feb 16, 2012 09:34 AM|LINK
Ofcourse it is possible/ you should use the connection and the command types of Oracle exactly as you use it in sql.
OracleCommand for commands and OracleParameter and OracleConnection....
Just add on the top of the file: using Syste.Data.OracleClient;
Hope I helped...
mishra.bhupe...
Participant
1596 Points
378 Posts
Re: Calling a procedure from oracle package.
Feb 16, 2012 09:52 AM|LINK
Thanks.
But as I know while calling to a stored procedure :
command.CommandText="StoredProcedureName"
//we adds parameters to above procedur.
But I want to know how to call a procdure from a package that is stored in oracle database. Kindly help me be delivering some lines of code.
Thanks again .
morefays
Participant
1139 Points
237 Posts
Re: Calling a procedure from oracle package.
Feb 16, 2012 10:09 AM|LINK
Packages and storeprocedure are same thing just calling package like this "SAS_SYS_PROC.PKG_ALERTS.INS_ALERTS"
~Please Mark As Answer, if one or multiple posts, which helped you in your problem. So that it might be useful for others~
dotnetfarrukhabbasblogspot
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: Calling a procedure from oracle package.
Feb 18, 2012 04:41 AM|LINK
Hello mishra:)
Addition——Don't forget to add cmd.CommandType=CommandType.StoredProcedure before executing ExecuteNonQuery() or do query things。
For more you can see the sample:http://www.c-sharpcorner.com/UploadFile/john_charles/CallingOraclestoredproceduresfromMicrosoftdotNET06222007142805PM/CallingOraclestoredproceduresfromMicrosoftdotNET.aspx(See Part6)