Correct the line

Hi,
How to correct 2nd line below
                                        p.csize.Equals(csize, StringComparison.OrdinalIgnoreCase) And
                                        p.nitemqty.Equals(nitemqty, vbDecimal.CompareTo)).FirstOrDefault

Open in new window

while the relevant field/column is with Decimal type?
LVL 11
HuaMin ChenProblem resolverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Phil DavidsonCommented:
There are two closing parentheses "))" but only one open "(" one.
0
chaauCommented:
for the Decimal object the Equals method takes only one argument. As a result the correct code should be:
p.csize.Equals(csize, StringComparison.OrdinalIgnoreCase) And
p.nitemqty.Equals(nitemqty)

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fernando SotoRetiredCommented:
I agree with chaat. Also the only time you would use FirstOrDefault is when you have more then one item such as a Collection.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

chaauCommented:
It looks like that was part of the bigger statement that tried to set a filter on the collection, thus the FirstOrDefault
0
Fernando SotoRetiredCommented:
If that was the  case it was not placed in the correct place seeming it was placed at the end of a comparison between two Decimals values.
0
chaauCommented:
There is an extra closing parentheses there for a reason, I guess
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.