fbpx
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

postgresql 13 Jan 2021 18:01 #17116

  • Juraj


  • Posts: 145
  • Hi All,does anyone have experience with postgres and dapper?Juraj

    Please Log in or Create an account to join the conversation.

    postgresql 13 Jan 2021 21:19 #17118

    • FFF


  • Posts: 1163
  • Hi Juraj,
    for PG ask Johan Nel, i think he uses it from the beginning... IIRC, Wolfgang R. also has it in production for some time.
    As for dapper, AFAIK, nobody has spoken here about it, sorry.
    Regards
    Karl (X# 2.7; Xide 1.27; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 05:51 #17119

    • wriedmann
    • wriedmann's Avatar


  • Posts: 2688
  • Hi Juraj,
    as Karl said: I'm using it in production, from VO (through a self written COM wrapper), X# and PHP (we have some larger projects on it).
    But for Dapper: I had to google it to understand what it is.
    I prefer to have less possible dependences in my code, and I have written my own (thin) libraries that expose the same functionality for PG, MS SQL, MySQL, SQLite and Oracle.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 09:32 #17120

    • Juraj


  • Posts: 145
  • Hi Wolfgang,Thank you for your response. I need to start a project quickly with Postgresql database in local network (3-4 clients), so it would be very helpful for me to use some validated existing libraries to save time. I will be grateful for any help.Juraj

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 09:36 #17121

    • FFF


  • Posts: 1163
  • Jurai,
    you are aware of npgsql.org? This should let you work with pg from x# like any DBMS via ado.net.
    @all: sorry for strange appeareance, can't hinder forum software from interfering with my text
    Regards
    Karl (X# 2.7; Xide 1.27; W8.1/64 German)
    Attachments:

    Please Log in or Create an account to join the conversation.

    Last edit: by FFF.

    postgresql 14 Jan 2021 09:37 #17122

    • wriedmann
    • wriedmann's Avatar


  • Posts: 2688
  • Hi Juraj,
    please give me a bit of time, and then I will publish my class library.
    Basically I'm having a class called PGConnection with methods like :GetDataTable( cSelect ) and :ExecuteStatement( cStmt ) that does all the work. And there are helper classes to build insert and update statements.
    All these classes I have are working the same manner for all the different SQL engines I need to use (the most used are MS SQL, PostgreSQL, SQLite and Oracle).
    The beauty of .NET is that you don't need any configuration on the client machines, and therefore I have build COM libraries for my VO applications that do exactly that.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 09:41 #17123

    • wriedmann
    • wriedmann's Avatar


  • Posts: 2688
  • Hi Juraj,
    this is my code to get a .NET DataTable from a PostgreSQL database:

    method GetDataTable( cSelect as string ) as DataTable
        local oAdapter            as NpgsqlDataAdapter
        local oDataSet            as DataSet
        local oDataTable        as DataTable

        oDataTable          := null_object

        try

        oAdapter            := NpgsqlDataAdapter{ cSelect, self:Connection }
        oDataSet            := Dataset{}
        oAdapter:Fill( oDataSet )
        oDataTable          := oDataSet:Tables[0]
        oDataSet            := null_object

        catch oEx as Exception

        _cLastError            := oEx:Message
        rdm.BaseLib.ErrorSys.InvokeExceptionHandler( oEx, cSelect )
        rdm.BaseLib.ErrorSys.ProcessException( oEx )

        end try

        return oDataTable

    Wolfgang
     
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Last edit: by wriedmann.

    postgresql 14 Jan 2021 11:26 #17124

    • rjpajaron
    • rjpajaron's Avatar


  • Posts: 351
  • We are using this. You can use the free Npgsql. But we used the paid Devart dotConnect for PostgreSQL.
    --

    Rene Pajaron

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 11:36 #17127

    • FFF


  • Posts: 1163
  • rjpajaron wrote: ...But we used the paid Devart dotConnect for PostgreSQL.
    Why? Just curious...
     

    Regards
    Karl (X# 2.7; Xide 1.27; W8.1/64 German)

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 12:12 #17129

    • rjpajaron
    • rjpajaron's Avatar


  • Posts: 351
  • It is more powerful and feature loaded. Key features that we use syncing data that Npgsql does not have.
    --

    Rene Pajaron

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 12:13 #17130

    • rjpajaron
    • rjpajaron's Avatar


  • Posts: 351
  • But some of our apps is using Npgsql.
    --

    Rene Pajaron

    Please Log in or Create an account to join the conversation.

    postgresql 14 Jan 2021 15:22 #17141

    • Frank Müßner


  • Posts: 209
  • Hi there,
    we use Postgres and XS2ADO and thus the normal data server

    Please Log in or Create an account to join the conversation.

    postgresql 15 Jan 2021 03:42 #17158

    • rjpajaron
    • rjpajaron's Avatar


  • Posts: 351
  • Hello Frank,

    I want to know more.

    My initial email on this to Robert, he told me XS2Ado is just a X# ported from VO2Ado.

    It is not ADO.NET. So, my question, how do you connect to PostgreSQL?
    1. It is via OLEDB/ODBC driver something that comes with Windows?
    2. Or something else.

    Thanks anyway for the info,

    --

    Rene
    --

    Rene Pajaron

    Please Log in or Create an account to join the conversation.

    postgresql 15 Jan 2021 10:33 #17164

    • Frank Müßner


  • Posts: 209
  • Hello Rene,
    my old VO Code use XS2ADO with the ODBC Driver:

    InitConnection := MyAdoConnection{}       
    InitConnection:ConnectionTimeout := 5
    InitConnection:CommandTimeout:=720
    InitConnection:CursorLocation := adUseClient
    InitConnection:ConnectionString:="Provider=MSDASQL.1;DRIVER=PostgreSQL Unicode;DATABASE=postgres;SERVER="+Server+";PORT="+port+";UID="+user+";PWD="+pw+";B9=0"
    InitConnection:Open(nil,nil,nil,nil)  
    oServer := MyAdoserver{"Select * from Table", InitConnection,adOpenKeyset,adlockoptimistic,nil}

    And for new Code i use Npgsql Functions. 

    Frank 

     

    Please Log in or Create an account to join the conversation.

    postgresql 21 Jan 2021 11:22 #17250

    • lumberjack
    • lumberjack's Avatar


  • Posts: 706
  • Hi Juraj,

    FFF wrote: Hi Juraj,
    for PG ask Johan Nel, i think he uses it from the beginning... IIRC, Wolfgang R. also has it in production for some time.

    Sorry for late reply was a couple of days (week) without internet connection. Please send me a private mail, I will have to get pieces of code out of Assemblies,but I do have examples of using PG with both direct Npgsql and DbProviderFactories (Database Agnostic) interfaces. Just need to extract the crucial bits since most of it is in Data-driven classes.

    johan(dot)nel(at)xsinet(dot)co(dot)za
    ______________________
    Johan Nel
    George, South Africa

    Please Log in or Create an account to join the conversation.

    postgresql 21 Jan 2021 11:45 #17251

    • Juraj


  • Posts: 145
  • Hi Johan

    I sent a message from my email.

    Juraj

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1