How to connect NAV with SQL DB (two different network)

crazydadecrazydade Member Posts: 3
Hi all !
I have a question: I have to connect my DB NAV (release 2016) with a SQL DB which is not on the same network.
NAV DB an the SQL DB are in two different city, two different network and the SQL DB is used from another program (no NAV).
I have either to read and write to this SQL DB.
Can I connect NAV to SQL?

I'm already using the connection between NAV and an external SQL DB, but always in the same network.

The connection now is managed in this way:

SQLConnection := SQLConnection.SqlConnection(ConnStr);

where

_ SQLConnection=Dotnet variable (System.Data.SqlClient.SqlConnection.'System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')

_ ConnStr = Text variable with this value:
Data Source= SQLservername; Initial Catalog= SQL DB;User Id= user;Password=password;

Can you help me? Thanks in advance to all.

Davide

Answers

  • krikikriki Member, Moderator Posts: 9,112
    [Topic moved from 'NAV Tips & Tricks' forum to 'NAV Three Tier' forum]

    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • crazydadecrazydade Member Posts: 3
    Someone can help me, please?
  • RemkoDRemkoD Member Posts: 100
    Hi Crazydade,
    I'm not a NAV developer myself, so I cannot help you with your exact question. From an architectural point of view. Isn't it possible to create the connection over HTTP(s) REST (SOAP/OData) webservices? If you create a web API on the external database side you can consume those web services from NAV. This could make the coupling a lot easier.
  • YuryYury Member Posts: 59
    Hi!
    Remko is right! You should have webservice for you external SQL DB and fetch data from NAV via webservice. Or, create webservice on NAV side and make some stored procedures in you SQL DB to fetch data from NAV. Depends on your task.
    Regards,
    Yury
  • KTA8KTA8 Member Posts: 397
    if you're able to connect throw VPN, you should be able to reach it like in a local network
  • crazydadecrazydade Member Posts: 3
    Thanks to everyone!
    I will update you how I will solve the problem
Sign In or Register to comment.