none
Wrong Results RRS feed

  • Question

  •  

    Having a problem where the results returned from a DLINQ query are incorrect and I'm struggling to see what I'm doing wrong.

     

    Here's the query:

    'Converting Firm Customers

    Dim FirmCustomers =        From F In HP3000DB.FIRM_MASTs _

    From C In HP3000DB.FIRM_CUSTOMERs _

    Where F._F_ORG_CODE = C.F_ORG_CODE And C.F_ORG_CODE = TempOrgCode _

    Select C

     

    Dim CustomerList = FirmCustomers.ToList()

     

    In this example the value in TempOrgCode is '31934'.

     

    When I iterate over the CustomerList all of the Customer objects have the same values but if I capture the SQL sent to SQL Server via Profiler and execute the SQL manually I get proper results like this:

    F_ORG_CODE ORG_NAME ADDRESS_1
    31934 Marsh Oak at Mayport           2768 STATE ROAD A1A          
    31934 SILVER CREEK APARTMENTS        300 SILVER CREEK ROAD        
    31934 PROPERTY MANAGEMENT DIVISION   9250 CYPRESS GREEN DR, STE 105
    31934 POLOS @ PONTE VEDRA            125 GREAT HARBOR WAY         
    31934 INVESTORS REAL ESTATE          MANAGEMENT, INC.             
    31934 SANDPIPER APARTMENTS           9536 PRINCETON SQUARE BLVD.  
    31934 City of Jacksonville           Building Dept.               
    31934 AMERICAN CLASSIC HOMES         P.O. BOX 24663               
    31934 Copeland Homes                 P.O. Box 23641               
    31934 THE GATE HOUSE APARTMENTS      18302 NW 68TH AVENUE         
    31934 Con Agra Feed                  2762 W. Beau Street          
    31934 MANDARIN VILLAS APARTMENTS     11648 PINE ACRES ROAD        
    31934 BLAIR STRINGFELLOW             4682 IVANHOE ROAD            
    31934 GLENMOOR APARTMENTS            ATTN:  LYNN HAM              
    31934 Mr. Perez                      233 W. Duval Street          
    31934 PROGRESSIVE BUILDING &         RENOVATIONS                  
    31934 Loftin & Company               9250 Cypress Green Drive     
    31934 BROOK CLAYTON                  1741 SWIMMING SALMON POINT N.
    31934 THE ANTLERS APARTMENTS         8433 SOUTHSIDE BLVD.         
    31934 BUILDING & ZONING              CITY HALL                    
    31934 LAKESIDE APARTMENTS            8700 SOUTHSIDE BLVD.         
    31934 MARKET SQUARE MALL             3637 PHILLIPS HIGHWAY        
    31934 Prince Manor Apartments                                     
    31934 Silver Springs Apartments      3737 S. St. Johns Bluff Rd.  
    31934 CITY OF JACKSONVILLE BEACH     BUILDING & ZONING DEPARTMENT 
    31934 CITY HALL OF NEPTUNE BEACH     1517 ATLANTIC BLVD.          
    31934 SEARS & ROEBUCK COMPANY        ATTN: GLORIA                 
    31934 Eagle One Construction Corp.   10343 Royal Palm Blvd.       
    31934 St. Johns Plantation           Apartments                   
    31934 J. D. ATCHISON                 3670 MARENGO DRIVE           
    31934 DADE COUNTY BUILDING & ZONING  111 N.W. 1ST ST. SUITE 1010  
    31934 ARROWHEAD APARTMENTS           10101 ARROWHEAD DRIVE EAST   
    31934 Brierwood Apartments           8880 S. Old Kings Road       
    31934 ST. JOHNS BAR PILOTS           ATTN:  CAPTAIN WALKER        

     

    In the example above I get 34 customer records in my list and every object has the values from the 'INVESTORS REAL ESTATE' row.

     

    What's going on here?  What am I doing wrong?

     

    Thanks,

    Mike

    Monday, March 24, 2008 8:47 PM

Answers

  • This likely a mapping problem.  It doesn't appear that your customer table has a primary or unique key.  My guess is that the F_ORG_CODE is being mapped as the primary key for customers, yet all these have the same value. 

     

    Tuesday, March 25, 2008 4:20 AM
    Moderator

All replies

  • This likely a mapping problem.  It doesn't appear that your customer table has a primary or unique key.  My guess is that the F_ORG_CODE is being mapped as the primary key for customers, yet all these have the same value. 

     

    Tuesday, March 25, 2008 4:20 AM
    Moderator
  •  

    Yep, that was it.  Thanks Matt.

     

    Regards,

    Mike D.

    Tuesday, March 25, 2008 12:21 PM