Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

calling oracle stored proc from .net

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vinki - 11 Jun 2007 20:29 GMT
Hello Everyone,

  I am trying to call a oracle stored proc from .net code and I am getting
an error
PLS-00306: wrong number or types of arguments in call to KSSP_MEMBER_NEW. I
counted all the number of parameters that I am passing and they seem to be
ok, but type can be the problem. In oracle stored proc , the type is defined
as for example:    dayPhone      IN  MEMBERTable.DayPhone%type
In my ocde I am definig day phone as DbType.string
db.AddInParameter(dbCommand, "dayPhone", DbType.String,
strList[137].ToString());

Is there any way I can define the dayPhone differently.
bob - 11 Jun 2007 22:37 GMT
Hi,
if using the Oracle client
OracleType.Varchar
hth
Bob

>Hello Everyone,
>
[quoted text clipped - 9 lines]
>
>Is there any way I can define the dayPhone differently.
Vinki - 12 Jun 2007 00:15 GMT
I am using oracleclient, but I want to use enterprise library too and with
enterprise library if I try to use oracleType.varchar, I get a syntax errror
The best overloaded method match for
'Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter(System.Data.Common.DbCommand,
string, System.Data.DbType, object)' has some invalid arguments   
This is what my code looks like
 db.AddInParameter(dbCommand, "dayPhone", OracleType.VarChar,
strList[9].ToString().Trim());

> Hi,
> if using the Oracle client
[quoted text clipped - 15 lines]
> >
> >Is there any way I can define the dayPhone differently.
Gregg Walker - 12 Jun 2007 01:34 GMT
> The best overloaded method match for
> 'Microsoft.Practices.EnterpriseLibrary.Data.Database.AddInParameter(System.Data.Common.DbCommand,
> string, System.Data.DbType, object)' has some invalid arguments
> This is what my code looks like
>  db.AddInParameter(dbCommand, "dayPhone", OracleType.VarChar,
> strList[9].ToString().Trim());

Vinki - You cannot use an OracleType where a DbType is called for.  I would
trying the following and see if it works.

db.AddInParameter(dbCommand, "dayPhone", DbType.String,
strList[9].ToString().Trim());

or ...

db.AddInParameter(dbCommand, "dayPhone", DbType.AnsiString,
strList[9].ToString().Trim());

Oracle should have a document that maps the OracleType values and .Net Type
values to DbType values.  This would help you figure out which DbType is
most appropriate for OracleType.VarChar.

--
Gregg Walker

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.