Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 883871
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T12:39:46+00:00 2026-05-15T12:39:46+00:00

The type for variable ‘cri’ will not be inferred because it is bound to

  • 0

The type for variable ‘cri’ will not be inferred because it is bound to a field in an enclosing scope. Either change the name of ‘cri’, of use the fully qualified name (for example, ‘Me.cri’ or ‘MyBase.cri’)

I have created a class file with name Predefined which consists of this methods like cricket,BasketBall from this methos im returning List of string type

im calling that class in button click event like the object of class is pre
now im calling a method called pre.Cricket();
so when i execute the program with warnings it is raising this error:

'Cricket' is not a member of 'predefined'.

this is the code where it is showing error in line 2:

Dim cric As New List(Of String)()
cric = pre.Cricket()
For cri As Integer = 0 To cric.Count - 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T12:39:47+00:00Added an answer on May 15, 2026 at 12:39 pm

    See this msdn article:

    http://msdn.microsoft.com/en-us/library/bb385162.aspx

    (from above)

    A loop control variable in your code
    has the same name as a field of the
    class or other enclosing scope.
    Because the control variable is used
    without an As clause, it is bound to
    the field in the enclosing scope, and
    the compiler does not create a new
    variable for it or infer its type.

    In the following example, Index, the
    control variable in the For statement,
    is bound to the Index field in the
    Customer class. The compiler does not
    create a new variable for the control
    variable Index or infer its type.

    Class Customer
    
        ' The class has a field named Index.
        Private Index As Integer
    
        Sub Main()
    
        ' The following line will raise this warning.
            For Index = 1 To 10
                ' ...
            Next
    
        End Sub
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a reference-type variable that is readonly , because the reference never change,
We all know that a readonly reference type variable's reference can't change, but the
In Java, why can't an array be a Type Variable's bound, but can be
How can the implicit type variable var know a type that is not defined
I want to define a ref type variable, like this: SomeType v=null; and this
i want to generate HMAC-SHA1 of NSString type variable. I see the post but
I need to get UserCarId(int) from this query and assign to int type variable.
I'm trying to read a file line by line to a string type variable
Is there a way to determine the type of variable passed to a template
Is there a way to declare that the variable type of a generic class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.