on 11-06-2017 10:10 PM - last edited on 02-04-2024 12:15 AM by postmig_api_4
I'd like to test speeds while reusing the same connection for multiple tasks (oInventoryGenExit , oInventoryGenEntry, etc.. ) compared to establishing the connection per task and disconnecting upon success..
SAPbobsCOM.Company Vcmp = new SAPbobsCOM.Company();
Vcmp.Server = "local";
Vcmp.CompanyDB = "TestDB";
Vcmp.DbServerType = SAPbobsCOM.BoDataServerTypes.dst_MSSQL2012;
Vcmp.DbUserName = "manger";
Vcmp.DbPassword = "password";
Vcmp.UserName = "manager";
Vcmp.Password = "password";
Vcmp.language = SAPbobsCOM.BoSuppLangs.ln_English;
Vcmp.LicenseServer = "0.0.0.0:30000";
Vcmp.UseTrusted = false;
int connected = Vcmp.Connect();
SAPbobsCOM.Documents oGoodsIssue = (SAPbobsCOM.Documents)Vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenExit);
...and so on..
note: I'm not disconnecting Vcmp at any point.
Everything works well the first attempt but I'm stuck trying to find/reference this active connection for subsequent tasks.. \
Is this possible? any sample code out there?
Thanks guys!
Hi Steve,
You can create your company object as static and use it where you want in your project, and just close it when you finish all your tasks.
Hope it helps.
Kind Regards,
Diego Lother
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Food for thought, I'm exploring that option. Thanks Diego,
To explain further, I have a web app (MVC) on Ipads which many ppl use simultaneously to update SAP.. My fantasy was that SAPbobscom exposed an existing open connection that i could use.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.