System.MissingMemberException: No default member found for type 'Integer'.

Hi, as a first VB.NET project I'm rewriting 1400 lines of VB 6 code. All goes well until I hit with what seems to be ridiculous compiler message. No matter what I try: casting to int, change the type to int 16, changing ExecuteScalar to ExecuteReader, ... Nothing works and any web searches didn't find anything useful.

The code is on my webspace--the code box messes up the formatting.

http://www.vocono.com/CloneLines.txt

Any help will be appreciated. Thank you.
bobcannAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
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.

CodeCruiserCommented:
You did not mention which line generates the error but going through the code, here is my conclusion.
We do not use ExecuteScalar with Stored Procedures. Use ExecuteNonQuery() and use the output parameter to get the return value

param.Value
0
Alfred A.Commented:
Hi,

This is just a "guess" based on what I see in your code,  two parameters are defined as Output regarding their direction, "@min_line_action_proposals__id" and "@max_line_action_proposals__id"

I guess your code from

lngMinLineActionProposalsId = param.Value("@min_line_actions__id")   <<< ERROR HERE
lngMaxLineActionProposalsId = param.Value("@max_line_actions__id")

should be

lngMinLineActionProposalsId = param.Value("@min_line_action_proposals__id")  
lngMaxLineActionProposalsId = param.Value("@max_line_action_proposals__id")

I hope my guess helps. :-)
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
Alfred A.Commented:
Just to add comment based on my previous post, I also conclude the changes based on the name of variable you use lngMinLineActionProposalsId and lngMaxLineActionProposalsID.

So, I guess it should be

lngMinLineActionProposalsId = param.Value("@min_line_action_proposals__id")  
lngMaxLineActionProposalsId = param.Value("@max_line_action_proposals__id")
0
PMI ACP® Project Management

Prepare for the PMI Agile Certified Practitioner (PMI-ACP)® exam, which formally recognizes your knowledge of agile principles and your skill with agile techniques.

bobcannAuthor Commented:
A good try, but a co-worker had the solution.
0
CodeCruiserCommented:
>but a co-worker had the solution.
Does that make our solutions bad in any way (as your grading indicates)?
0
bobcannAuthor Commented:
Thanks guys, my bad on the misnamed parameters. The error still occurred when corrected. A co-worker pointed out that "param" was not a collection as was used. FYI his solution is posted.

Thanks for the good attempt and more questions to follow!
cmd.ExecuteScalar()

lngMinLineActionProposalsId =  _   cmd.Parameters("@min_line_action_proposals__id").Value

lngMaxLineActionProposalsId = _         cmd.Parameters("@max_line_action_proposals__id").Value

Open in new window

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
Microsoft Development

From novice to tech pro — start learning today.