xsharp.eu • OK you've finally got me, X# is very cool!
Page 1 of 5

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

Posted: Sun Mar 10, 2019 1:54 am
by Anonymous
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?

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

Posted: Sun Mar 10, 2019 4:38 am
by Chris
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.

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

Posted: Sat Mar 16, 2019 2:16 am
by BiggyRat
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.

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

Posted: Sat Mar 16, 2019 6:03 am
by lumberjack
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...

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

Posted: Sat Mar 16, 2019 6:57 am
by wriedmann
Hi Jeff,
what type of data do you need? From DBF sources or from SQL databases?
Wolfgang

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

Posted: Sat Mar 16, 2019 8:03 am
by BiggyRat
I use dbfcdx Wolfgang. Which I know is not ready yet, so just playing around with dbfntx.

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

Posted: Sat Mar 16, 2019 9:20 am
by wriedmann
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

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

Posted: Sat Mar 16, 2019 9:36 am
by lumberjack
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,

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

Posted: Sat Mar 16, 2019 9:41 am
by robert
Johan,
I know Paul very well and he has no problem if you share this document.

Robert

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

Posted: Sat Mar 16, 2019 9:52 am
by lumberjack
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":

Code: Select all

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:

Code: Select all

tableGrid:DataSource := datatable
Voila, done, dusted!

If you want to sort your data, no set order to index.

Code: Select all

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!