Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Executing Ianywhere DB Stored Procedure from DOT NET

5 posts in General Discussion Last posting was on 2003-05-27 17:44:08.0Z
shankar Posted on 2003-05-22 21:24:22.0Z
From: shankar@netgalactic.com
Date: Thu, 22 May 2003 17:24:22 -0400
Newsgroups: ianywhere.public.general
Subject: Executing Ianywhere DB Stored Procedure from DOT NET
Message-ID: <FD53144C2E4F83A70075968285256D2E.0075969B85256D2E@webforums>
Lines: 48
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1057
Article PK: 3014

could anybody guide me about how to call the stored procedure of Ianywhere
database from the DOTNET Code. Currently i'm using OLEDB classes of DOTNET
to call the SP. i'm using the same classes to call the SQL script its
executing fine. But when i call the SP through OLEDBCommand object its not
executing. It simply hangs. i'm passing the arguments to SP by adding
parameters to the command object.

it simply hangs out, no output

hereunder attaching my sample code

Dim conConn As New
OleDbConnection("Provider=ASAProv.80;eng=SampleServer;uid=dba;pwd=sql")


conConn.Open()
Dim comComm As OleDbCommand = conConn.CreateCommand
Try
comComm.Parameters.Add(New OleDbParameter("@empid",
OleDbType.Integer)).Value = 2
comComm.Parameters("@empid").Direction =
ParameterDirection.Input
comComm.Parameters.Add(New OleDbParameter("@firstname",
OleDbType.VarChar, 100)).Value = "Amar"
comComm.Parameters("@firstname").Direction =
ParameterDirection.Input
comComm.Parameters.Add(New OleDbParameter("@lastname",
OleDbType.VarChar, 100)).Value = "Nath"
comComm.Parameters("@lastname").Direction =
ParameterDirection.Input
comComm.Parameters.Add(New OleDbParameter("@address",
OleDbType.VarChar, 100)).Value = "BTM Layout Blore"
comComm.Parameters("@address").Direction =
ParameterDirection.Input
comComm.Parameters.Add(New OleDbParameter("@contactnos",
OleDbType.VarChar, 100)).Value = "-NIL-"
comComm.Parameters("@contactnos").Direction =
ParameterDirection.Input

comComm.CommandText = "call
sp_updatetest1(@empid,@firstname,@lastname,@address,@contactnos)"

comComm.CommandType = CommandType.StoredProcedure
comComm.ExecuteNonQuery()

please guide about this issue
waiting for your response

Thanks in advance
Shankar


Jason Hinsperger Posted on 2003-05-22 21:18:23.0Z
From: "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com>
References: <FD53144C2E4F83A70075968285256D2E.0075969B85256D2E@webforums>
Subject: Re: Executing Ianywhere DB Stored Procedure from DOT NET
Date: Thu, 22 May 2003 17:18:23 -0400
Lines: 70
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#iEbrgKIDHA.220@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: hinsperg-pc1.sybase.com 172.31.143.226
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1058
Article PK: 3011

What does your stored procedure do? Is it perhaps blocking?
Some things to try:
1) Try making all arguments inputoutput
2) Add some message statements to the procedure to see if the procedure is
executing at all.

--
Jason Hinsperger
International and Sustaining Engineering
iAnywhere Solutions

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer
--

<shankar@netgalactic.com> wrote in message
news:FD53144C2E4F83A70075968285256D2E.0075969B85256D2E@webforums...
> could anybody guide me about how to call the stored procedure of Ianywhere
> database from the DOTNET Code. Currently i'm using OLEDB classes of DOTNET
> to call the SP. i'm using the same classes to call the SQL script its
> executing fine. But when i call the SP through OLEDBCommand object its not
> executing. It simply hangs. i'm passing the arguments to SP by adding
> parameters to the command object.
>
> it simply hangs out, no output
>
> hereunder attaching my sample code
>
> Dim conConn As New
> OleDbConnection("Provider=ASAProv.80;eng=SampleServer;uid=dba;pwd=sql")
>
>
> conConn.Open()
> Dim comComm As OleDbCommand = conConn.CreateCommand
> Try
> comComm.Parameters.Add(New OleDbParameter("@empid",
> OleDbType.Integer)).Value = 2
> comComm.Parameters("@empid").Direction =
> ParameterDirection.Input
> comComm.Parameters.Add(New OleDbParameter("@firstname",
> OleDbType.VarChar, 100)).Value = "Amar"
> comComm.Parameters("@firstname").Direction =
> ParameterDirection.Input
> comComm.Parameters.Add(New OleDbParameter("@lastname",
> OleDbType.VarChar, 100)).Value = "Nath"
> comComm.Parameters("@lastname").Direction =
> ParameterDirection.Input
> comComm.Parameters.Add(New OleDbParameter("@address",
> OleDbType.VarChar, 100)).Value = "BTM Layout Blore"
> comComm.Parameters("@address").Direction =
> ParameterDirection.Input
> comComm.Parameters.Add(New OleDbParameter("@contactnos",
> OleDbType.VarChar, 100)).Value = "-NIL-"
> comComm.Parameters("@contactnos").Direction =
> ParameterDirection.Input
>
> comComm.CommandText = "call
> sp_updatetest1(@empid,@firstname,@lastname,@address,@contactnos)"
>
> comComm.CommandType = CommandType.StoredProcedure
> comComm.ExecuteNonQuery()
>
> please guide about this issue
> waiting for your response
>
> Thanks in advance
> Shankar


shankar Posted on 2003-05-22 23:47:38.0Z
From: shankar@netgalactic.com
Date: Thu, 22 May 2003 19:47:38 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Executing Ianywhere DB Stored Procedure from DOT NET
Message-ID: <08C1CC9C5FE69B710082B3DB85256D2E.007BD2B185256D2E@webforums>
References: <FD53144C2E4F83A70075968285256D2E.0075969B85256D2E@webforums> <#iEbrgKIDHA.220@forums-1-dub>
Lines: 15
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1062
Article PK: 3015

Jason

i tried making all the arguments INOUT, still its not working. its getting
hang when i execute the ASP.NET script which call the SP now also.

the same SP is executing fine in OPEN INTERACTIVE SQL with arguments.
None of the code here is blocking. its really a simple SP contains only one
update statement.

Could you provide me if any example .NET code to call the SP's of IAnywhere
if possible. it will be great helpful.

waiting for ur reply
Thanks
Shankar


Jason Hinsperger Posted on 2003-05-23 13:08:57.0Z
From: "Jason Hinsperger" <NOJason_HinspergerSPAM@hotmail.com>
References: <FD53144C2E4F83A70075968285256D2E.0075969B85256D2E@webforums> <#iEbrgKIDHA.220@forums-1-dub> <08C1CC9C5FE69B710082B3DB85256D2E.007BD2B185256D2E@webforums>
Subject: Re: Executing Ianywhere DB Stored Procedure from DOT NET
Date: Fri, 23 May 2003 09:08:57 -0400
Lines: 68
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <euuy2zSIDHA.220@forums-1-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: hinsperg-pc1.sybase.com 172.31.143.226
Path: forums-1-dub!forums-master.sybase.com!forums-1-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1063
Article PK: 3982

Did you put a message statement in your stored procedure to see if it is
even being called from the application?
I would recommend that you use the ASA managed provider though. It ships
with the latest 8.0.2 ebf.
If you are using the OLEDB managed provider, you should make sure to be at
the latest ebf of 8.0.2.
Here is a sample which uses the OLEDB managed provider to call a procedure.
To switch it to the ASA managed provider, just change the "OLEDB" types to
"ASA" types after you've installed the ASA managed provider.

public void test_sp_output_parms(OleDbConnection myLocalConnection)
{
System.DateTime sStartTime;
TimeSpan elapsed;
string MeRefNo;
string timeelstr;

try {
OleDbCommand SPCMD = new OleDbCommand("test2", myLocalConnection);
SPCMD.CommandType = CommandType.StoredProcedure;

OleDbParameter myParm = SPCMD.Parameters.Add(
"@arg1",OleDbType.Integer );
OleDbParameter myParm2 = SPCMD.Parameters.Add(
"@arg2",OleDbType.Integer );
SPCMD.Parameters["@arg1"].Direction = ParameterDirection.InputOutput ;
SPCMD.Parameters["@arg2"].Direction = ParameterDirection.InputOutput ;

sStartTime = System.DateTime.Now;
SPCMD.ExecuteNonQuery();
elapsed = System.DateTime.Now - sStartTime;
timeelstr = elapsed.TotalMilliseconds.ToString();
} catch(Exception e) {
throw(e);
}
}

--
Jason Hinsperger
International and Sustaining Engineering
iAnywhere Solutions

Whitepapers, TechDocs, and bug fixes are all available through the iAnywhere
Developer Community at www.ianywhere.com/developer
--

<shankar@netgalactic.com> wrote in message
news:08C1CC9C5FE69B710082B3DB85256D2E.007BD2B185256D2E@webforums...
> Jason
>
> i tried making all the arguments INOUT, still its not working. its getting
> hang when i execute the ASP.NET script which call the SP now also.
>
> the same SP is executing fine in OPEN INTERACTIVE SQL with arguments.
> None of the code here is blocking. its really a simple SP contains only
one
> update statement.
>
> Could you provide me if any example .NET code to call the SP's of
IAnywhere
> if possible. it will be great helpful.
>
> waiting for ur reply
> Thanks
> Shankar


shankar Posted on 2003-05-27 17:44:08.0Z
From: shankar@netgalactic.com
Date: Tue, 27 May 2003 13:44:08 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Executing Ianywhere DB Stored Procedure from DOT NET
Message-ID: <76D3715366D6A74900616CB085256D33.004D514885256D2F@webforums>
References: <FD53144C2E4F83A70075968285256D2E.0075969B85256D2E@webforums> <#iEbrgKIDHA.220@forums-1-dub> <08C1CC9C5FE69B710082B3DB85256D2E.007BD2B185256D2E@webforums> <euuy2zSIDHA.220@forums-1-dub>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1087
Article PK: 3367

Thanks Jason,

It works
Shankar