New to X# and need some direction

Public support forum for peer to peer support with related to the Visual Objects and Vulcan.NET products
Post Reply
Anonymous

New to X# and need some direction

Post by Anonymous »

Hi Guys,

This is my second day with X# and learned a fair bit but still lost. I would need some help.

Basically I need to access an MS-SQL Database and extract data and upload it using the access provided through the .NET SDK.

This is the SDK: http://developer.myob.com/api/accountri ... otnet_sdk/
that I need to use to upload the data

I am an old VO programmer that stuck with VO and just about to move to X# with this small project. I have already downloaded XIDE and also Vs but I think I will go with XIDE for the time being as long as I can utilise the above SDK.

I do not have Vulcan so do I need anything additional to install or XIDE installation is sufficient on its own for Native X#?

Any help and pointers will be greatly appriciated

Thanks again

Tom
User avatar
wriedmann
Posts: 3776
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

New to X# and need some direction

Post by wriedmann »

Hi Tom,

you don't need any special runtime or similar - you can work with X# right out of the box.

Maybe you should search some C# samples and move them over to X#.

Please don't forget: as VO programmers we were almost alone, but with X# we are a part of the really large .NET world.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
lumberjack
Posts: 729
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

New to X# and need some direction

Post by lumberjack »

tom@dieselworks.com.au wrote:
Basically I need to access an MS-SQL Database and extract data and upload it using the access provided through the .NET SDK.

This is the SDK: http://developer.myob.com/api/accountri ... otnet_sdk/
that I need to use to upload the data
Here is a quick and dirty translate from the above website. Remember it is C# which use ";" as end of statement, so we need to remove that. All "new" keywords basically mean creation of object, X# like VO uses {}, so we need to change () to {} except where it is a method call where () is used the same. C# also use "=" for assignments, X#/VO use ":="

Code: Select all

using MYOB.AccountRight.SDK
using MYOB.AccountRight.SDK.Services
using MYOB.AccountRight.SDK.Contracts

var configuration := ApiConfiguration{"http://localhost:8080/accountright"}
var cfService := CompanyFileService{configuration}
var companyFiles := cfService.GetRange()

//Next step in the flow is to select a company file that supports v2 contracts
// for the AccountRight API - anything from 2013.3 and up will do here.
var companyFile := companyFiles.FirstOrDefault({x => Version{x.ProductVersion} >= Version{"2013.3"}})

//The company file credentials are an AccountRight requirement with the SDK providing the 
//CompanyFileCredentials class to encapsulate these. For our example the company file 
//login details in use are username: Administrator with no password on the admin account.
var credentials := CompanyFileCredentials{"Administrator",""}

//Now you are ready to start accessing resources directly from the API
var accountService := AccountService{configuration}
var accounts := accountService.GetRange(companyFile,null,credentials)
I do not have Vulcan so do I need anything additional to install or XIDE installation is sufficient on its own for Native X#?
No you need nothing extra, XIDE as it is can even be an editor for c# and Harbour. You just need to tell it the Application is of that type.
Only thing you have to do is in your MYOB interface application Add a reference to the MYOB Assembly. You will have to do this also in VS.

Hope this helps.
______________________
Johan Nel
Boshof, South Africa
tom@dieselworks.com.au

New to X# and need some direction

Post by tom@dieselworks.com.au »

Thanks VM Johan, Can you tell me when I install the XIDE, it also asks me if I like to install the Community Edition of the VS. Installing the VS which options do I need to select ? TIA Tom
User avatar
lumberjack
Posts: 729
Joined: Fri Sep 25, 2015 3:11 pm
Location: South Africa

New to X# and need some direction

Post by lumberjack »

tom@dieselworks.com.au wrote:
Thanks VM Johan, Can you tell me when I install the XIDE, it also asks me if I like to install the Community Edition of the VS. Installing the VS which options do I need to select ?
If you already have VS, then you don't need to install it again. Just make sure you install XIDE. It wont' hurt to install the VS Community if you don't have VS installed yet.

Regards,
______________________
Johan Nel
Boshof, South Africa
tom@dieselworks.com.au

New to X# and need some direction

Post by tom@dieselworks.com.au »

Ok, getting close :-) One more question: "Add a reference to the MYOB Assembly" - how do I do this?
FFF
Posts: 1589
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

New to X# and need some direction

Post by FFF »

Hi Tom,
in Xide, in the Projectpane, there's an entry References unter each app in the tree. Rightclick, "Add reference", point in the dialog to the assembly you need.

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
tom@dieselworks.com.au

New to X# and need some direction

Post by tom@dieselworks.com.au »

Ah well, still a prob: I have installed the package in VS -> Install-package MYOB.AccountRight.API.SDK - and I can see it, it installed into the default app in VS - but I can't see it from XIDE
User avatar
wriedmann
Posts: 3776
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

New to X# and need some direction

Post by wriedmann »

Hi Tom,

Visual Studio uses NuGet to retrieve the packages, XIDE cannot do that.

In these cases I use an VS project to download the references, copy the assemblies away and add them to the XIDE project.

Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
FFF
Posts: 1589
Joined: Fri Sep 25, 2015 4:52 pm
Location: Germany

New to X# and need some direction

Post by FFF »

Wolfgang,
i have no clue about Nuget, but it seems there's a commandline version available, maybe one could use this for a Xide-extension? Just a thought ;)

Karl
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Post Reply