Call a Stored Procedure from Navision Code

Holly
Member Posts: 18
Hi all
Version 4, SQL Server option
I am working with a colleague on an external app for use in our company. This App will need to get data from Navision and Navision will have to get data from the App.
The App is being written in VB.Net and Sql Server. We want to write a Stored Procedure that selects from both the new App's db and from the Navision db. Then both Navision and the App can call the same Stored Procedure to get information.
Does anyone have any idea how I would go about calling a SQL Stored Procedure from within Navision? Any help would be greatly appreciated.
Version 4, SQL Server option
I am working with a colleague on an external app for use in our company. This App will need to get data from Navision and Navision will have to get data from the App.
The App is being written in VB.Net and Sql Server. We want to write a Stored Procedure that selects from both the new App's db and from the Navision db. Then both Navision and the App can call the same Stored Procedure to get information.
Does anyone have any idea how I would go about calling a SQL Stored Procedure from within Navision? Any help would be greatly appreciated.
0
Comments
-
Just search for VB6 examples on the Internet and transform it to Navi similar way as basic VB6 ADO is transformed to Navi here: http://www.mibuso.com/dlinfo.asp?FileID=5890
-
Thank You very much for your quick reply. I'll look at it right now.
Thanks again.0 -
I'm trying to achieve something similar but with ASP.NET calling a stored procedure to extract data from navision and display it on the intranet. I've written a stored procedure to return the data and saved it in the Navision database.
The stored procedure works when called from Query Analyser and from a VB6 program, it also works as a data source in the ASP.NET IDE.
However the stored procedure doesn't seem to execute when the website runs in a browser.
Any ideas whilst I have hair left ? ](*,)Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Toddy Boy wrote:I'm trying to achieve something similar but with ASP.NET calling a stored procedure to extract data from navision and display it on the intranet. I've written a stored procedure to return the data and saved it in the Navision database.
The stored procedure works when called from Query Analyser and from a VB6 program, it also works as a data source in the ASP.NET IDE.
However the stored procedure doesn't seem to execute when the website runs in a browser.
Any ideas whilst I have hair left ? ](*,)
chech Profiler to see what errors it gives back. My guess is Permissions. Do you know what is the username for connection that you make through web?0 -
Im awaiting a little quiet time before I can see what the profiler is giving me
This is getting more bizarre, if I call the stored procedure in asp.net i.e. not as part of the binding but in the page load) it works !!Surely that runs under the same security as if the stored procedure is called from the data bound object.
Life is for enjoying ... if you find yourself frowning you're doing something wrong0 -
Cracked it \:D/
The stored procedure has 3 parameters 2 of which are optional. In the .NET IDE the parameters for the 2 optionals have default values of a blank string. When this is executed the stored procedure failed to run.
However, if I include the ConvertEmptyStringToNull="false" on the 2 optional select parameters then shockingly the procedure works. =D> =D> =D>
Does Navisions SQL Server installation have some magic that stops NULLs beign passed to stored procedures? :-k
CheersLife is for enjoying ... if you find yourself frowning you're doing something wrong0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions