Last post Jul 08, 2010 08:19 AM by sirdneo
None
0 Points
16 Posts
Jun 24, 2010 03:58 AM|dotnetnepal|LINK
Hello evreryone,
I have a oracle stored procedure to run the following query:
select * from emp where hiredate=:pDate and deptno like nvl(:pDeptNo,'%')
and I am passing the parameters using C# like this;
pDate = new OracleParameter();
pDate.ParameterName = "pDate";
pDate.OracleType = OracleType.DateTime;
pDate.Size = 10;
pDate.Direction = ParameterDirection.Input;
pDate.Value = Label1.Text;
mycommand.Parameters.Add(pDate);
and similar for deptno. as well
but I am not able to show the filtered data in gridview.
Can somebody suggest me how to solve this?
Thanks.
Member
35 Points
52 Posts
Jul 07, 2010 09:36 PM|aspnoob07|LINK
Are you receiving Oracle errors or just not returning any rows?
At what point are you converting the value from Label1.Text to a datetime?
Star
10444 Points
2463 Posts
Jul 08, 2010 08:19 AM|sirdneo|LINK
Following samples will be usefull for you:-
http://www.4guysfromrolla.com/articles/062905-1.aspx
http://www.c-sharpcorner.com/UploadFile/john_charles/CallingOraclestoredproceduresfromMicrosoftdotNET06222007142805PM/CallingOraclestoredproceduresfromMicrosoftdotNET.aspx
None
0 Points
16 Posts
how to pass parameters to oracle stored procedured from asp.net and c#
Jun 24, 2010 03:58 AM|dotnetnepal|LINK
Hello evreryone,
I have a oracle stored procedure to run the following query:
select * from emp where hiredate=:pDate and deptno like nvl(:pDeptNo,'%')
and I am passing the parameters using C# like this;
pDate = new OracleParameter();
pDate.ParameterName = "pDate";
pDate.OracleType = OracleType.DateTime;
pDate.Size = 10;
pDate.Direction = ParameterDirection.Input;
pDate.Value = Label1.Text;
mycommand.Parameters.Add(pDate);
and similar for deptno. as well
but I am not able to show the filtered data in gridview.
Can somebody suggest me how to solve this?
Thanks.
Member
35 Points
52 Posts
Re: how to pass parameters to oracle stored procedured from asp.net and c#
Jul 07, 2010 09:36 PM|aspnoob07|LINK
Are you receiving Oracle errors or just not returning any rows?
At what point are you converting the value from Label1.Text to a datetime?
Star
10444 Points
2463 Posts
Re: how to pass parameters to oracle stored procedured from asp.net and c#
Jul 08, 2010 08:19 AM|sirdneo|LINK
Following samples will be usefull for you:-
http://www.4guysfromrolla.com/articles/062905-1.aspx
http://www.c-sharpcorner.com/UploadFile/john_charles/CallingOraclestoredproceduresfromMicrosoftdotNET06222007142805PM/CallingOraclestoredproceduresfromMicrosoftdotNET.aspx
Zeeshan Umar
~Please Mark As Answer, one or multiple posts, which helped you. So that it might be useful for others~