天道酬勤,学无止境

myob

callback based async method with multiple parameters to awaitabletask

问题 我有以下代码连接到 MYOB 的 SDK var cfsCloud = new CompanyFileService(_configurationCloud, null, _oAuthKeyService); cfsCloud.GetRange(OnComplete, OnError); 在哪里 private void OnComplete(HttpStatusCode statusCode, CompanyFile[] companyFiles) { // ask for credentials etc } 我想将其转换为使用 TaskCompletionSource 像这个例子 但是我的 OnComplete 有多个参数。 我该如何编码? 回答1 正如评论中提到的 Accountright API 的 SDK 支持 async/await 即 GetRangeAsync 所以如果你想/需要将它包装在 TaskCompletionSource 中,你可以做这样的事情 static Task<CompanyFile[]> DoWork() { var tcs = new TaskCompletionSource<CompanyFile[]>(); Task.Run(async () => { var cfsCloud = new CompanyFileService(

2022-04-22 05:07:12    分类:技术分享    c#   asynchronous   callback   myob

callback based async method with multiple parameters to awaitabletask

I have the following code to connect to MYOB's SDK var cfsCloud = new CompanyFileService(_configurationCloud, null, _oAuthKeyService); cfsCloud.GetRange(OnComplete, OnError); where private void OnComplete(HttpStatusCode statusCode, CompanyFile[] companyFiles) { // ask for credentials etc } I want to convert this to use a TaskCompletionSource like this example however my OnComplete has multiple parameters. How do I code that?

2022-04-17 07:52:04    分类:问答    c#   asynchronous   callback   myob

How do you tap into MYOB from a .NET app?

I'm interested in finding out how to interface a .NET app (or even just about any app running on any platform, maybe even Java or PHP) with MYOB. There's a system already in place that uses MYOB but the business owner wants their different branch offices to be able to interact with each other. I would be really interested to know the possible approaches to this problem from those of you who are familiar with this. Many thanks :)

2022-03-16 17:23:11    分类:问答    .net   integration   myob

C# - 使用不同的 ODBC 驱动程序连接来自两个不同数据库的表(C# - Join tables from two different databases using different ODBC drivers)

问题 我有一个 C# 应用程序,它需要从两个不同的数据库中提取数据:数据库 1 是一个 MYOB 数据库(它使用 ODBC 使用 MYOB 的驱动程序连接)数据库 2 是一个 Access 数据库,我再次使用 ODBC 连接到它。 例如。 这是我想运行的查询: $query = "SELECT * FROM [" + myobConnectString + "].Accounts, ["+accessConnectString+"].tblTest WHERE tblTest.ID = Accounts.AccountID"; 我的问题是如何运行它(或者甚至可能)? 谢谢! 回答1 除了其他答案之外,您还可以使用 ODBC 连接引擎,例如 ODBC-ODBC 连接引擎中的那个。 但是,这将在本地提取数据并为您执行连接,因此它具有与 Nickoli 在其答案末尾概述的类似缺点。 回答2 按照您编写查询的方式,答案是否定的。 原因很简单,因为查询本身是在单个引擎上运行的。 哪个引擎会按照您编写的方式运行查询? 如果其中一个数据库服务器能够提供对另一个数据库服务器的直接访问(SQL Server 具有此功能,但我现在忘记了名称),那么单个引擎可以执行此操作,因为它可以访问另一个。 很可能,您唯一的解决方案是将两个表中的数据加载到本地应用程序中,然后将数据加入内存中。 根据记录的数量

2021-08-31 10:45:57    分类:技术分享    c#   database   odbc   myob

C# - Join tables from two different databases using different ODBC drivers

I have a C# application which needs to pull data from two different databases: Database 1 is a MYOB database (which uses ODBC to connect using MYOB's driver) Database 2 is an Access database, again I'm using ODBC to connect to it. Eg. this is the query I would like to run: $query = "SELECT * FROM [" + myobConnectString + "].Accounts, ["+accessConnectString+"].tblTest WHERE tblTest.ID = Accounts.AccountID"; My question is how can I run this (or if it's even possible)? Thanks!

2021-08-30 23:17:33    分类:问答    c#   database   odbc   myob