Best way to use Microsoft SQL database in X#

This forum is the place to discuss issues related to ReportPro, Xs2Ado, Vo2Ado, bBrowser and other 3rd party products
User avatar
Kees Bouw
Posts: 121
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

Best way to use Microsoft SQL database in X#

Post by Kees Bouw »

Hi Everyone,

Currently I am working on a conversion project to move a VO application to X#. The VO application uses Microsoft SQL Server with Vo2Ado. Of course Xs2Ado is available but is there a "native" X# way to do it? Or perhaps by calling C# code from X#? We are also considering other alternatives like PostgreSQL but for that the database needs to be converted I think. Any advice about the best way to move forward is greatly appreciated.

Kees.
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by wriedmann »

Hi Kees,
to use SQL Server in X# there are several ways:
- of course you can use XS2ADO, that would save you the time to rewrite the entire database layer
- the "native" way to talk to SQL databases in .NET is ADO.NET
- and you could also use the Entity Framework
If you are rewriting the application completely, i.e. moving to Windows Forms or WPF, I would reccomend ADO.NET, but if you are maintaining the VO GUI classes XS2ADO would be IMHO the best option.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by wriedmann »

Hi Kees,
sorry, I have forgotten about PostgreSQL: that is an entire different database, and has some differences to the Microsoft SQL Server.
PostgreSQL is free to use and open source and works very well: we are using it in VO, X# and PHP projects, and are very happy with our choice.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
stecosta66
Posts: 52
Joined: Mon Sep 26, 2016 12:59 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by stecosta66 »

Hi all,

I'm in a similar situation but using PostgreSQL instead of MS Sql Server.
Just finished converting my largest VO application to use PostgreSQL as backend with Vo2Ado.

At the beginning of new year i'm planning to start conversion from Vo to X#.
Any advice on upgrading and use Xs2Ado to shortening development time or use Npgsql .NET Data Provider for PostgrSQL?
Or there is any viable alternative to consider?

Thanks!
Stefano
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by wriedmann »

Ciao Stefano,
if you would like to keep the migration effort as small as possible, keep XS2ADO. If you have used the VO2ADO RRD for your conversion: it is not available in XS2ADO.
To go with the Npgsql driver you will have to rewrite the data part of your application.
Wolfgang
P.S. I also have a X# COM component for VO that uses the Npgsql driver
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
stecosta66
Posts: 52
Joined: Mon Sep 26, 2016 12:59 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by stecosta66 »

Ciao Wolfgang,

thanks for the advice. I've not used Vo2Ado RDD.
Just out of curiosity, Xs2Ado can be compiled in 64bit native as target platform?
User avatar
wriedmann
Posts: 3765
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by wriedmann »

Ciao Stefano,
about using XS2ADO in AnyCPU mode I don't know - let's wait what Robert says.
But if you are migrating to X# using the VO GUI classes: they don't work in AnyCPU mode.
To have a VO compatible GUI that runs in AnyCPU (and has support for Unicode) you need the XGUI classes (that are the new VOGUI compatible classes based on Windows Forms). They are included in the subscriber version of X# and should work well starting with X# 2.8. Currently you don't have the bBrowser and ReportPro in these classes.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
robert
Posts: 4540
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Best way to use Microsoft SQL database in X#

Post by robert »

Wolfgang, Stefano,

Xs2Ado is designed to be used with the VO GUI classes. These classes do not support AnyCPU/x64.
I have not tried it, but I expect that the classes will also work with anyCPU.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
stecosta66
Posts: 52
Joined: Mon Sep 26, 2016 12:59 pm
Location: Italy

Re: Best way to use Microsoft SQL database in X#

Post by stecosta66 »

Wolfgang, Robert

so I should stick with VO Gui to use Xs2Ado.
Any chance to got it working with the new XGui classes or WinUI?

Thanks!
Stefano
User avatar
robert
Posts: 4540
Joined: Fri Aug 21, 2015 10:57 am
Location: Netherlands

Re: Best way to use Microsoft SQL database in X#

Post by robert »

Stefano,
To make it use with the XGUI classes I would have to create an extra DLL that is compatible with these classes.
Since these classes are not officially ready yet, I have not done that.
But that makes sense.

Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Post Reply