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?
 
Alfred A.Connect With a Mentor 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
 
CodeCruiserConnect With a Mentor Commented:
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:
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
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

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

All Courses

From novice to tech pro — start learning today.