fbpx
Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET

TOPIC: OK you've finally got me, X# is very cool!

OK you've finally got me, X# is very cool! 6 months 6 days ago #7608

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Thanks to all for your help, you especially Chris, so far (no doubt it'll be needed again soon probably) . But finally I've got X# displaying windows with all sorts of controls on them, doing all sorts of magic that was almost impossible in VO (at least to me anyway)

One thing that still doesn't appear possible is changing the colour of the actual border on a Groupbox. That was a bugbear for me in VO, and I used a very sloppy workaround to get the desired look, but hopefully that might be added in a future release.of X#.

Only one thing, am I right in assuming I can't actually create a DBServer object and therefore not actually create a Database based program in X# at this point?

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

OK you've finally got me, X# is very cool! 6 months 5 days ago #7609

  Chris's Avatar Chris Offline Posts: 1335
Glad to see you are starting to enjoy X#! :)

Yeah, the GUI classes have remained the same in X#, but if you were using a trick for something, that trick should work also in X#. Possibly with minor changes, if it uses very low level stuff.

About DBServers, you can create them with no issue, only thing is you cannot import/export from a from/to a physical dbf file in the DBEditor. But you can create this dbf file by any other means (from the DBServer editor in VO, with code, from a DBF utility etc), put it in the folder that your app expects it and it should work fine, exactly as in VO. You just can't use CDX indexes just yet, but Robert has almost finished work on it, it should be available very soon.

Actually very soon we will get out of this hybrid mode we are at the moment, having to support both the vulcan and the X# runtime, the X# runtime will be the new standard one to use, so everything else will also become more straightforward, regarding the IDEs etc.
XSharp Development Team
chris(at)xsharp.eu

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

OK you've finally got me, X# is very cool! 6 months 1 hour ago #7769

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
But how do you access that database? Like for example, putting fields on a form. I tried using a textbox (which I'm assuming is the X# equivalent of an SLE) I get you can't use DBFCDX yet (that of course is THE most important RDD to me). Databases are vitally important to my apps, so this is incredibly important.

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7772

  lumberjack's Avatar lumberjack Away Posts: 543
Jeff,

BiggyRat wrote: But how do you access that database? Like for example, putting fields on a form. I tried using a textbox (which I'm assuming is the X# equivalent of an SLE) I get you can't use DBFCDX yet (that of course is THE most important RDD to me). Databases are vitally important to my apps, so this is incredibly important.

Slow down cowboy...
One step at a time. We will get you there, are you able to already create a form with a DataGridView? If so, then start Reading about DataBinding, DbProviderFactories .... We still feeding the filly, just wait, we will rodeo...
______________________
Johan Nel
George, South Africa

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7773

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Jeff,
what type of data do you need? From DBF sources or from SQL databases?
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7774

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
I use dbfcdx Wolfgang. Which I know is not ready yet, so just playing around with dbfntx.

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

Last edit: by BiggyRat.

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7775

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Jeff,
I have to prepare a sample for you using WinForms and DBF.
Currently I have them only for WPF (my development choice).
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7777

  lumberjack's Avatar lumberjack Away Posts: 543
Hi Wolfgang,
Just wondering Paul Piko's VulcanAtWarpSpeed document should be a good read for somebody like Jeff. Just wonder about implications for sharing? It only for Vulcan users?
Regards,
______________________
Johan Nel
George, South Africa

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7778

  robert's Avatar robert Offline Posts: 1155
Johan,
I know Paul very well and he has no problem if you share this document.

Robert
XSharp Development Team
The Netherlands

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7779

  lumberjack's Avatar lumberjack Away Posts: 543
Jeff,

BiggyRat wrote: I use dbfcdx Wolfgang. Which I know is not ready yet, so just playing around with dbfntx.

WinForms work with DataTable, BindingSource, DataSets... You can read up on them. Here is a small incomplete example of getting a DBF into a DataTable, no index required. Basically just a "select * from dbftable":
DBUseArea(TRUE,"DBFCDX",dbfName)
// Make some columns for the table from each column in the DBF
FOR i := 1 UPTO FCount()
  datatable:Columns:Add( DataColumn{ FIELDNAME(i) } )
NEXT
// Now load with data
DO WHILE ! EOF()
  // Create a new row
  row := datatable:NewRow()
  // Put data into the columns in the row
  FOR i := 1 UPTO FCount()
    row[ FIELDNAME(i) ] := AsString(FieldGet(i))
  NEXT
  // Add the row to the table
  datatable:Rows:Add(row)
  // Move to next record
  DBSkip()
ENDDO
DBCloseArea()
If you now have your datatable, you need to tell your grid to use it as DataSource:
tableGrid:DataSource := datatable
Voila, done, dusted!

If you want to sort your data, no set order to index.
datatable:DefaultView:Sort := "LASTNAME desc"
Search datatable on MSDN, look at all the properties and methods. Get this in your knowledge base then we look at DataSets, DataBinding, DataSource, Relations etc...

Happy X#ing!
______________________
Johan Nel
George, South Africa

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7780

  lumberjack's Avatar lumberjack Away Posts: 543
Thanks Robert, well maybe Wolfgang can add it to his XSharp webpage then... Easy then to just tell people to follow the link and download...
@Wolfgang?
______________________
Johan Nel
George, South Africa

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

Last edit: by lumberjack.

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7781

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Johan,
it's already there: (the link)
www.govulcan.net/portal/LearningVulcanNE...abid/59/Default.aspx
on the page
docs.xsharp.it/doku.php?id=quickstart_xsharp_vo
Or should the dokument itself being added to the wiki?
In that case we should ask Paul about permission and "refresh" it for X#, and add how to use the samples with Visual Studio and XIDE.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7782

  lumberjack's Avatar lumberjack Away Posts: 543
Hi Wolfgang,
Yes think we need to break links to other sites if possible. I think yes, it might be the way to do it, get confirmation from Paul if we can share it there. I think even for VFP guys getting into X# a couple of the things like I showed Jeff regarding getting a DBF into a datatable is applicable, no worries about indexes, just a pure "select * from dbftable" approach.
______________________
Johan Nel
George, South Africa

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7835

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Jeff,

please pay attention to a very important change between the native .NET data objects (DataSet, DataTable) and the way a DBServer works in Visual Objects:
A .NET DataTable is disconnected data, i.e you read all data into memory, and then work on this data. This may not be a problem with small data, but for larger tables this is a problem.
If you use the DataBrowser or bBrowser in VO: these controls read only the data needed to be displayed, so you can browse even large tables.
.NET is SQL based, and therefore you need to define the data you wish to read before you read them.
So for the migration of an application to WinForms or .NET using DBF tables you must take the same considerations as ina migration to SQL.
But my customers are changing what they expect from a database application: in the past incremental index searches were very important, but now they request more and more filters.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7836

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Jeff,

please find attached a small WinForms application that uses a DBF from the SSA application and DBFNTX.
You can set the path to your local data in the ProgSettings module.
The application is in the XIDE export format, so you need this IDE to import and run the application.
Comments are welcome.

File Attachment:

File Name: WinformDBF.viaef
File Size:8 KB

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it
Attachments:

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

OK you've finally got me, X# is very cool! 5 months 4 weeks ago #7837

  FoxProMatt_MattSlay's Avatar FoxProMatt_MattSlay Offline Posts: 171
I've downloaded you sample app, but I'm not clear on where I can find the DBF and any other data files that are needed.

Please advise....

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

Last edit: by FoxProMatt_MattSlay.

OK you've finally got me, X# is very cool! 5 months 3 weeks ago #7838

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Matt,
I'm very sorry, I forgot that not everyone has a VO installation.
Please find attached a zip file with the needed DBF table and NTX index.

File Attachment:

File Name: Customer_SSATutor.zip
File Size:2 KB

Wolfgang
P.S. I will prepare another sample the next days, and a few samples (but most wih VO backgrounds) can be found here: www.riedmann.it/verschiedenes_xsharp.php
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it
Attachments:

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

OK you've finally got me, X# is very cool! 5 months 3 weeks ago #7839

  BiggyRat's Avatar Topic Author BiggyRat Offline Posts: 206
Thank you so much Wolfgang, that example has made a MASSIVE difference to my understanding of how that side of things work in X#

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

OK you've finally got me, X# is very cool! 5 months 3 weeks ago #7840

  wriedmann's Avatar wriedmann Away Posts: 1739
Hi Jeff,
you are welcome!
VO had the advantage that the GUI Classes were tightly bound to the DBF sequential data storage, so both the DataBrowser and bBrowser (and GridPro of course) could work very well with this data.
But times have changed and the time of sequential data storage (would it be DBF, Access, Cobol data, and many more) is over, and therefore also the time of databrowsers.
But if you need that type of data access also in a WinForms application: through a compatibility layer in WinForms you could put a bBrowser control on a WinForms window.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy

www.riedmann.it - docs.xsharp.it

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

OK you've finally got me, X# is very cool! 5 months 3 weeks ago #7841

  Chris's Avatar Chris Offline Posts: 1335

BiggyRat wrote: Thank you so much Wolfgang, that example has made a MASSIVE difference to my understanding of how that side of things work in X#


Jeff, just to be clear for anybody else reading this thread, this is only ONE of the ways of how things work in X#. This is how you'd do things using standard .Net clasees with WinForms, but nothing stops you from still using the same DBServer class you are used to in VO, and you can use it the exact same way in X#. Also if you did a WPF app, you'd again use a different approach.

Btw, thanks for the sample Wolfgang, very nice! I would like to include also this in the XIDE samples if you do not mind. Although it would be even better if you can add some comments in the code of how to use it and explain a bit how it works.
XSharp Development Team
chris(at)xsharp.eu

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