) expected  
Author Message
NoEgo





PostPosted: Visual C# Language, ) expected Top

I get the following 2 errors and can't figure out how to get rid of this issue

) expected
Invalid expression term ','

 

for my following code 

 

private static void AddNewProduct(ExcelWrapper     xl, string FileExtension, string ProductType, string FilePath, string FileName, bool moveFile, SellerStore sstore)

                        {

                                    string prAudID;

                                    bool created = false;

 

                                    string description = xl[row,2].Trim();

                                    string productName = xl[row,6].Trim();

                                               

                                                 

                                    Product JuudAlb =   null;

                       

                                    JuudAlb = ProductAbstraction.Load(prAudID, sty.StelID, out created, TransactionAbstraction.GetTransaction());

                                               

                                     // Set fields of the Product Object

                                    JuudAlb.ProductName = productName;

                                     ProductAbstraction.SetLongDescription = (JuudAlb, description); s- Problem this line

                                     ProductAbstraction.SetShortDescription(JuudAlb, description.Substring(150));

… rest of code here and so on

 

Notes on the abstraction method and it's params.:

 

Product.ProductAbstration.SetLongDescription(Product pr, string desc)

 

The SetShortDescription method call is fine, with no complaints in VS, but the longdescription method is what is giving me the errors. Both expect the same type of parameters so don't see why the SetLongDescription call is having difficulty.

 




Visual C#5  
 
 
Mark Dawson





PostPosted: Visual C# Language, ) expected Top

Hi,

looks like SetLongDescription is amethod you need to call it like:

ProductAbstraction.SetLongDescription(JuudAlb, description);

without the assignment operator. If you have a property then you can use the assignment operator i.e.

class Test

{

public void FooMethod(string name)

{

//do some stuff i.e. string x = name;

}

public string FooProperty

{

set

{

//do some stuff i.e. string x = value;

}

}

}

The you can do either:

Test t = new Test();

t.FooMethod("hello"); or

t.FooProperty = "hello";

Mark.



 
 
FavorFlave





PostPosted: Visual C# Language, ) expected Top

yea, I was just blind. Thanks!