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

TOPIC: SQL Example to get local Cursor???

SQL Example to get local Cursor??? 4 months 3 weeks ago #9859

  FoxProMatt_MattSlay's Avatar Topic Author FoxProMatt_MattSlay Offline Posts: 308
Can someone give me a simple code example to send a query to SQL Server and get a local Cursor of records?

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9860

  lumberjack's Avatar lumberjack Offline Posts: 627
Hi Matt,

FoxProMatt_MattSlay wrote: Can someone give me a simple code example to send a query to SQL Server and get a local Cursor of records?

I use DataTable as my local cursors
var cmd := SQLCommand{"select * from <table>", oConn}
cmd:Connection:Open()
var dataReader := cmd:ExecuteReader()
var dataTable := DataTable{}
dataTable:Load(dataReader)
______________________
Johan Nel
George, South Africa

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9861

  FoxProMatt_MattSlay's Avatar Topic Author FoxProMatt_MattSlay Offline Posts: 308
I’m looking for work areas or cursors, like FoxPro, not .Net data tables.

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9863

  wriedmann's Avatar wriedmann Away Posts: 1912
Hi Matt,

the VO SQL classes have a SQLSelect and a SQLTable class for this, and therefore they are also in the current X# VO compatible libraries. But in VO they don't open up a workarea, they are objects that can be connected to a datawindow or databrowser.

To have such a functionality in X# you'll have to wait for the development team to build these classes (for the FoxPro runtime).

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9864

  lumberjack's Avatar lumberjack Offline Posts: 627
Hi Wolfgang/Matt,

wriedmann wrote: the VO SQL classes have a SQLSelect and a SQLTable class for this, and therefore they are also in the current X# VO compatible libraries. But in VO they don't open up a workarea, they are objects that can be connected to a datawindow or databrowser.
To have such a functionality in X# you'll have to wait for the development team to build these classes (for the FoxPro runtime).

If my memory serves me right, Robert indicated that the idea would be to have a "cursor" type wrapped around DataTable, hence why I suggested DT. Otherwise, probably a bit of a rework of ArrayServer or bArrayServer might be the solution...
______________________
Johan Nel
George, South Africa

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9866

  wriedmann's Avatar wriedmann Away Posts: 1912
Hi Johan,

anyway - currently there is no way, since there is no FoxPro compatible runtime.
And it can take some time as it is a lot of work.... and IMHO it makes not too much sense to spend now time in these functionalities if other more basic FoxPro languages features are to be implemented.
As you know, development time is always too short.... Robert could easily quadruplicate his time, and it would always not be enough.
Wolfgang
P.S. as you know, I'm doing in X# what I see as possible (the last time a extension to Combit cRM), but I'm ways behind my plan to migrate my VO applications to X#
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9867

  robert's Avatar robert Offline Posts: 1373
Matt,
Wofgang is right. This is NOT in the product yet.
In VO we have an OOP layer on top of workareas and another OOP layer on the SQL API.

We are planning to support the FoxPro SQL.. functions and select the resulting data in a DataTable/DataView (like Johan said) and use this as data for a workarea. A SQL RDD you could call this. This will be part of the FoxPro runtime.

Robert
XSharp Development Team
The Netherlands

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

SQL Example to get local Cursor??? 4 months 3 weeks ago #9868

  lumberjack's Avatar lumberjack Offline Posts: 627
Hi Wolfgang,

wriedmann wrote: anyway - currently there is no way, since there is no FoxPro compatible runtime.

Fully agree, and hence why I try and stay away from XBase style interfaces if there is an alternative .NET feature. It is less work in the end to rather create wrappers around XBase style features, e.g. DBFToDataTable() etc. to not keep you bound to VO classes.

And it can take some time as it is a lot of work.... and IMHO it makes not too much sense to spend now time in these functionalities if other more basic FoxPro languages features are to be implemented.
As you know, development time is always too short.... Robert could easily quadruplicate his time, and it would always not be enough.

I know and I appreciate what Robert is doing, feels sometimes even when I try to assist as if I do not have the capability of assisting...

P.S. as you know, I'm doing in X# what I see as possible (the last time a extension to Combit cRM), but I'm ways behind my plan to migrate my VO applications to X#

I know, it is quite a balance between keeping software running and migrating to .NET/X#
______________________
Johan Nel
George, South Africa

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

Last edit: by lumberjack.

SQL Example to get local Cursor??? 4 months 3 weeks ago #9869

  FoxProMatt_MattSlay's Avatar Topic Author FoxProMatt_MattSlay Offline Posts: 308
Indeed, my interest was to explore X sharp from an Xbase programming style. I just wasn’t sure if the recent work with had brought it to that stage yet.

I know there are .net alternatives but since XSharp is billed as an X base replacement candidate, I want to work at it from the xBase perspective to see what limits it runs into.

I’ll keep waiting and maybe the September release may have this capability.

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

  • Page:
  • 1