SQL Server Stored Procedures (.NET)

General discussion forum about all databases other than SqlBase.
ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

SQL Server Stored Procedures (.NET)

Post by ivano_osti » 21 Dec 2015, 15:20

Hi.

First of all I must say that probably this is NOT A BUG. Certainly it is a lack of knowledge from me.

I call SQL Server stored procedures as "Win32" application with no problem. My problem is that I need to call as ".NET" and I'm not having success.

I attached a small sample (Win32.apt) that I use to call SQL Server stored procedures as "Win32" application with no problem. This sample uses "OdrPrepareProc()".

I also attached the same sample as ".NET" application. In this one, I try to call the stored procedure using "OdrPrepareProc()" with SqlConnect() OR SqlConnectDotNet() and I have errors with both.

Error with SqlConnectDotNet: Could not find stored procedure '@nRet int exec SPR_TEST @param1,@param2,@nRet OUTPUT select @nRet'.
Error with SqlConnect: [Microsoft][ODBC SQL Server Driver]Invalid parameter type.

I also tried with "SqlPrepareSP()" instead "OdrPrepareProc()" with no success.

I ask your help please. Any tip is welcome.

Thank you.
You do not have the required permissions to view the files attached to this post.

ivano_osti
Brazil
Posts: 415
Joined: 17 Nov 2017, 20:02
Location: Itapira-SP, Brazil

Re: SQL Server Stored Procedures (.NET)

Post by ivano_osti » 22 Dec 2015, 19:27

Hi.

I had success.

Samples attached as my contribution for the forum.

Thank you.

PS: In the samples, running with SqlConnectDotNet() works fine. If you run with SqlConnect() the result is not the same and I don't know why. If one of you figure out the problem, please let me know.
You do not have the required permissions to view the files attached to this post.

VEspinal

Re: SQL Server Stored Procedures (.NET)

Post by VEspinal » 24 Dec 2015, 00:08

Hi Ivano:

Thanks for the forum contribution. It is much appreciated.

IMO, SqlConnect() should work too in .NET

Best Regards,
Victor

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest