SQL Example to get local Cursor???
SQL Example to get local Cursor???
Can someone give me a simple code example to send a query to SQL Server and get a local Cursor of records?
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
SQL Example to get local Cursor???
Hi Matt,
I use DataTable as my local cursorsFoxProMatt_MattSlay wrote:Can someone give me a simple code example to send a query to SQL Server and get a local Cursor of records?
Code: Select all
var cmd := SQLCommand{"select * from <table>", oConn}
cmd:Connection:Open()
var dataReader := cmd:ExecuteReader()
var dataTable := DataTable{}
dataTable:Load(dataReader)
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
SQL Example to get local Cursor???
I’m looking for work areas or cursors, like FoxPro, not .Net data tables.
SQL Example to get local Cursor???
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
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
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
SQL Example to get local Cursor???
Hi Wolfgang/Matt,
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...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).
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
SQL Example to get local Cursor???
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#
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
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
SQL Example to get local Cursor???
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
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
robert@xsharp.eu
The Netherlands
robert@xsharp.eu
- lumberjack
- Posts: 727
- Joined: Fri Sep 25, 2015 3:11 pm
- Location: South Africa
SQL Example to get local Cursor???
Hi Wolfgang,
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.wriedmann wrote: anyway - currently there is no way, since there is no FoxPro compatible runtime.
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...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, it is quite a balance between keeping software running and migrating to .NET/X#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#
______________________
Johan Nel
Boshof, South Africa
Johan Nel
Boshof, South Africa
SQL Example to get local Cursor???
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.
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.