DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: No default member found for type 'Integer'

  1. #1
    Join Date
    Feb 2008

    No default member found for type 'Integer'

    I'm trying to compare an integer to a integer on a binding source:

    Dim a As Integer = pickup.PickUpID
    Dim b As Integer = CInt(BindingSource.Current("PickUpID"))
    If a = b Then...

    On line 2 I get "No default member found for type 'Integer'"

    I've tried to Integer.Parse it, and CINT it, and google it, yet no success.

    Thanks for any help in advance.

  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    Assuming the underlaying binding source is a database field, what is the field type of "PickUpId"?

  3. #3
    Join Date
    Feb 2008
    Its an integer. And the first line works without any problems.

    For some reason the data from the binding source doesn't want to compare. But when I check it is says {Integer}

  4. #4
    Join Date
    Feb 2004
    Longueuil, Québec
    First, you should have a variable to reference your BindingSource. The way the code is writte, it tries to reference the class directly. Current is not a Shared (static) property, so it cannot be call on the class.

    Second, I have found with experience that direct assignment in a declaration does not always work. Have you tried this:

    Dim b As Integer
    b = CInt(variable.Current("PickUpID"))

    CInt has also failed me a couple of time in the 6 years I have been working in .NET, while the Convert class always work. It is also preferred, since it is the .NET way, not the VB way, and can be used in all languages:

    b = Convert.ToInt32(variable.Current("PickUpID"))
    Jacques Bourgeois

Similar Threads

  1. Replies: 0
    Last Post: 11-17-2000, 07:43 AM
  2. Replies: 0
    Last Post: 11-17-2000, 12:50 AM
  3. How do I detect an FTP timeout?
    By Julian Milano in forum VB Classic
    Replies: 2
    Last Post: 08-11-2000, 12:11 PM
  4. Replies: 0
    Last Post: 06-01-2000, 03:10 PM
  5. Trying to print a PDF File from VB
    By Kunal Sharma in forum VB Classic
    Replies: 2
    Last Post: 04-25-2000, 03:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center