English (United States)
Call us! 512-349-0334 or (877) INDUSOFT

InduSoft Web Studio Forums

Find additional forum posts in in the Forum Archives. For assistance view the Forum Frequently Asked Questions.

PostgreSQL Sample
Last Post 04 Jan 2019 04:58 PM by dustin_m. 10 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
Rafa SilvaUser is Offline
Advanced Member
Advanced Member
Posts:55


--
20 Jan 2015 03:23 PM


    The main objective of this topic is not the sample application itself, but how to get it to work


    Indusoft uses Microsoft Technology (ADO.Net) to communicate with Database Servers. Any database server that has a .Net, ODBC or OLE Provider can be accessed by Indusoft through the Indusoft Database Gateway.

    To enable the Indusoft Database Gateway (STADOSvr.exe) to communicate with PostgreSQL you'll need to add some configuration to it's initialization file, as follows:

    1. Close all Indusoft process.
    2. Make a backup copy of your STADOSvr.ini file.(this file is located on [Indusoft Installation Path]\Bin\)
    3. Open the STADOSvr.ini file 
    4. On the [Providers} section, change the line where you have Count=8 to Count=9 (or if you have already configured other Providers you'll need to add +1 to that counter, so if it's 9 you change to 10, and so on and so forth)
    5. In the end of the [Providers] section add the following lines:

    Provider9=NPGSQL
    Assembly9=Npgsql
    ConnectionClass9=Npgsql.NpgsqlConnection
    DataAdapterClass9=Npgsql.NpgsqlDataAdapter
    CommandBuilderClass9=Npgsql.NpgsqlCommandBuilder
    BoolType9=Boolean
    IntegerType9=Numeric
    RealType9=Real
    StringType9=Text
    TimeStampType9=timestamp without time zone
    EnableTop9=0
    EnableLimit9=1

    6. Save the STADOSvr.ini file.

    At this point we have configured the Indusoft Database Gateway to use the NPGSQL (Provider) classes to communicate with PostgreSQL. There are plenty other providers to communicate with PostgreSQL, we decided to work with this one because it's free of charge (Community Maintened) and it works great.

    What happens now is that if you don't have the Provider installed to your computer those classes that we just configured won't be find by the Operational System. So go ahead, download and install your NPGSQL PostgreSQL .Net Provider and install it on your computer.

    You can find the installer at: http://pgfoundry.org/frs/download.p...-net45.exe

    NOTICE:: INDUSOFT DATABASE GATEWAY shipped with version  71.3 IS COMPILED WITH THE .NET FRAMEWORK 4.5, you need to install a compatible version of NPGSQL, in order to work.

    After this configuration you just need to configure your DataSource Settings with the following Connection String:

    Provider=NPGSQL; Server=127.0.0.1;Port=5432;Database=myDataBase;User Id=myUsername; Password=myPassword;

    [change the information on the connection string as needed]









    postgre.zipStADOSvr.zip
    SeanTUser is Offline
    Advanced Member
    Advanced Member
    Posts:57


    --
    27 Jan 2015 04:58 PM
    Cool post! Big fan of postgres and I've been using it for a while now with my IWS app. For my app, the npgsql provider works fine by just placing their dll and the security dll in the InduSoft install's Bin folder. Also, is the integertype=numeric correct?


    alex_dUser is Offline
    New Member
    New Member
    Posts:4


    --
    08 Nov 2016 07:15 AM
    Try to up this post.
    I need to get data from my PostgreSQL. I make all as in first comment, but in Runtime the Studio Database Gateway show me an ERROR that NPGSQL provider is not registered on the local machine
    I install the latest version Npgsql 3.1.8. May be something with compatibility of OS (Windows Server 2008 R2) and Npgsql? If someone had such problem ill be glad with help of this issue.


    alex_dUser is Offline
    New Member
    New Member
    Posts:4


    --
    08 Nov 2016 08:22 AM
    I deeply apologize, my bad. I forget to change Count to 9...


    Rafa SilvaUser is Offline
    Advanced Member
    Advanced Member
    Posts:55


    --
    10 Feb 2017 12:39 PM

    An update on the NPGSQL download link for Windows:

    https://github.com/npgsql/npgsql/releases/download/v3.2.0/Npgsql-3.2.0.msi

    Just tested on the newer version of postgre and it works perfectly;



    zovaUser is Offline
    New Member
    New Member
    Posts:6


    --
    27 Aug 2017 12:06 PM
    I use Windows10 x64 and Postgresql 9.6.3 x 64. NPGSQL 3.2.5 has been installed too. What should I check up if provider NPGSQL isn't in Data Link Properties?
    If I enter connection string manually CMD_ADD error occurs.


    zovaUser is Offline
    New Member
    New Member
    Posts:6


    --
    28 Aug 2017 02:21 PM
    Didn't works. Log from STADOSrv attached.




    1.txt
    Larry CombsUser is Offline
    Forum Moderator
    Forum Moderator
    Posts:139


    --
    28 Aug 2017 02:35 PM

    When you run the NPGSQL installer make sure you enabled the option to install the assembly to the GAC:



    Larry CombsUser is Offline
    Forum Moderator
    Forum Moderator
    Posts:139


    --
    28 Aug 2017 02:50 PM

    You might also consider dotConnect for PostgreSQL from a company called Devart.  Do this:

    1. Stop your project and close any InduSoft Web Studio software, including the Studio Database Gateway.

    2. Download and install dotConnect for PostgreSQL Express from http://www.devart.com/dotconnect/po...load.html.

    3. Open StADOSvr.ini using Notepad.

    4. Look for the section called [Providers].  Change

      Count=8

      to

      Count=9

      Then and add the following to the end of the [Providers] section:

      Provider9=PGCLIENT
      Assembly9=Devart.Data.PostgreSql
      ConnectionClass9=Devart.Data.PostgreSql.PgSqlConnection
      DataAdapterClass9=Devart.Data.PostgreSql.PgSqlDataAdapter
      CommandBuilderClass9=Devart.Data.PostgreSql.PgSqlCommandBuilder
      ValueString9=@Value
      ValueAddNumber9=1
      EnableTop9=0
      EnableLimit9=1
      TimeStampType9=TIMESTAMP

    5. Use a connection string that looks like the following when you create your database connection in InduSoft Web Studio.

      Provider=PGCLIENT; host=; database=;

      Where is the name of the server to connect to (e.g., localhost) and is the name of the PostgreSQL database to use.  Make sure you enter your database login and password as well.

    These instructions use the free Express edition.  There are other editions available including an edition for .NET Compact Framework if desired.  To see a comparison of all the edition go to https://www.devart.com/dotconnect/postgresql/editions.html.



    zovaUser is Offline
    New Member
    New Member
    Posts:6


    --
    02 Sep 2017 01:46 PM
    OK! It works. Thanks.
    More over, I placed primary BD locally and secondary BD on Debian9 separate machine. It seems all works fine.


    dustin_mUser is Offline
    New Member
    New Member
    Posts:2


    --
    04 Jan 2019 04:58 PM
    Great.

    I think installing NPGSQL with GAS helped me connect.

    Also: I think having "http://" in my connection string address was causing issues!

    Better support for non-MSSQL databases would be nice!!


    You are not authorized to post a reply.