hejingsong
9th February 2010, 10:05
Hi all:

I am using below code to test OLE in .net (c#) .but always get BaanVObj.ReturnValue 0 even when I key in correct warehouse and item,
anybody could help what happened?


Baan.BwCOleAutomationServerClass BaanVObj = new Baan.BwCOleAutomationServerClass();
BaanVObj.Timeout = 300;

string warehouse = Chr(34) + textBox_wh.Text.ToUpper().Trim() + Chr(34);
string item = Chr(34) + textBox_item.Text.ToUpper().Trim() + Chr(34);


BaanVObj.ParseExecFunction ("owhwmddll0007","whwmd.dll0007.item.present.in.warehouse(" + warehouse + ","+item+" )");

int ij = BaanVObj.Error;
string KK=BaanVObj.ReturnValue;

BaanVObj.Quit();

MilindV
9th February 2010, 13:15
Hi

Put space after comma while passing arguments.

BaanVObj.ParseExecFunction("owhwmddll0007","whwmd.dll0007.item.present.in.warehouse(" + warehouse + ", "+item+" )");

May this will solve ur problem.

Thanks and Regards
MilindV

hejingsong
10th February 2010, 03:13
Great !
Milindv, thanks a lot.