var a=conn.getData2();//getting the value from a global class conn.cs
OracleConnection con = conn.s();
OracleCommand oc = new OracleCommand("logedin(I need to pass the value here)", con);
logedin is strored procedure :-
create procedure logedin(user_id in int)
as
begin
update user_details set status='logedin'
where userid=user_id;
end;
the issue is very simple , i would lke to pass the value into the stored proc that was retrieved by the variable into the database.any suggestion how ???
Member
8 Points
38 Posts
pass value into stored procedure
Jun 05, 2010 05:15 AM|potupaul|LINK
this is my form :-
var a=conn.getData2();//getting the value from a global class conn.cs
OracleConnection con = conn.s();
OracleCommand oc = new OracleCommand("logedin(
I need to pass the value here)", con);logedin is strored procedure :-
create procedure logedin(user_id in int)
as
begin
update user_details set status='logedin'
where userid=user_id;
end;
the issue is very simple , i would lke to pass the value into the stored proc that was retrieved by the variable into the database.any suggestion how ???
<asp.net> <%@ Page Language="C#" %>
All-Star
124328 Points
10142 Posts
Re: pass value into stored procedure
Jun 05, 2010 09:42 AM|SGWellens|LINK
Since the Oracle object use the same interfaces as the Sql objects I think the technique should be the same:
My blog
All-Star
101931 Points
20703 Posts
Re: pass value into stored procedure
Jun 05, 2010 09:44 AM|MetalAsp.Net|LINK
This might help: http://www.c-sharpcorner.com/UploadFile/john_charles/CallingOraclestoredproceduresfromMicrosoftdotNET06222007142805PM/CallingOraclestoredproceduresfromMicrosoftdotNET.aspx
Member
8 Points
38 Posts
Re: pass value into stored procedure
Jun 06, 2010 01:12 AM|potupaul|LINK
OracleCommand objCmd = new OracleCommand();
objCmd.Connection = objConn;
objCmd.CommandText = "count_emp_by_dept";
objCmd.CommandType = CommandType.StoredProcedure;
objCmd.Parameters.Add("pin_deptno", OracleType.Number).Value = 20;
i have a variable which the user is putting there value and i need to pas that not an exact value of 20 as above code :-
var a=conn.getdata2();
OracleCommand objCmd = new OracleCommand();
objCmd.Connection = objConn;
objCmd.CommandText = "count_emp_by_dept";
objCmd.CommandType = CommandType.StoredProcedure;
objCmd.Parameters.Add("pin_deptno", OracleType.Number).Value =a;
but while i am wriring this code the the execute quer is not working and coming up with some error ???
Member
8 Points
38 Posts
Re: pass value into stored procedure
Jun 07, 2010 01:59 AM|potupaul|LINK
where are the rep ???