problem when use ExpressionToApply in Remoting/WCF mode

Posts   
 
    
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 03-Mar-2009 06:36:11   

I'm coding in a remoting mode. Here is my code

----Client Side


   BussInlistEntity inlist=new BussInlistEntity();
   inlist.BussinessCode="ABC";
   inlist.Fields[(int)BussInlistFieldIndex.ProductId].ExpressionToApply=new ScalarQueryExpression(BaseBinFields.ProductId,BaseBinFields.BinCode=='123456');

   ServerManager.SaveEntity(inlist);

---Server Side


   public void SaveEntity(CommonEntityBase entity)
   {
         using(DataAccessAdapter adapter=new DataAccessAdapter())
         {
                adapter.SaveEntity(entity);
         }
   }

when i monitor in server side,I found the filed "ProductId"'s CurrentValue is "null",and I set the filed "ProductId" is not null in db. So if I continue the code,an exception "null value is not allowed" throwed.

But when I use these code in "Local" mode,It will successfuly insert a new record to DB.

How can I use ExpressionToApply in a remoting mode? Especially when I want to set/update a DateTime field to "sysdate" because the timezone of Client Side and Server Side are different.

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 03-Mar-2009 09:41:18   

Which LLBLGen Pro runtime library version are you using?

What would happen if you use the folloiwng code at client side?

BussInlistEntity inlist=new BussInlistEntity();
inlist.BussinessCode="ABC";
inlist.ProductId = xyz;
inlist.Fields[(int)BussInlistFieldIndex.ProductId].ExpressionToApply=new ScalarQueryExpression(BaseBinFields.ProductId,BaseBinFields.BinCode=='123456');

ServerManager.SaveEntity(inlist);
xc_lw2000
User
Posts: 48
Joined: 12-Dec-2006
# Posted on: 07-Mar-2009 00:06:08   

Walaa wrote:

Which LLBLGen Pro runtime library version are you using?

What would happen if you use the folloiwng code at client side?

BussInlistEntity inlist=new BussInlistEntity();
inlist.BussinessCode="ABC";
inlist.ProductId = xyz;
inlist.Fields[(int)BussInlistFieldIndex.ProductId].ExpressionToApply=new ScalarQueryExpression(BaseBinFields.ProductId,BaseBinFields.BinCode=='123456');

ServerManager.SaveEntity(inlist);

I'm using V2.5

I haven't try this. why set exactly value to the field 'ProductId',and then set its ExpressionToApply?The ScalarQueryExpression's return value will not be 'xyz' and I don't know what it will be unless execute the ScalarQueryExpression.

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 07-Mar-2009 03:53:06   

I think this thread is related to http://llblgen.com/TinyForum/Messages.aspx?ThreadID=14726

You are using ExpressionToApply for inserts. That isn't supported (http://llblgen.com/TinyForum/Messages.aspx?ThreadID=12892)

David Elizondo | LLBLGen Support Team