This is a migrated thread and some comments may be shown as answers.

Parameter expression has unexpected type

1 Answer 58 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Daniel
Top achievements
Rank 2
Daniel asked on 05 Apr 2011, 06:06 PM
I am fairly new to linq and ef, any help is appriciated.

The query runs fine in Linqer but errors when I bind it to my listbox, I have added .ToList but I get the same results, it seems
as though my query results is returning the wrong type.  I dont know what I am doing wrong with this query, below is the code
TIA.

''Where Not In GenresMovieLink
       Dim qry = From genres In dbContext.Genres _
            Where _
            Not _
            (From genres0 In dbContext.Genres _
             From movies In genres0.Movies _
             Where _
               CLng(movies.MovieID) = 19 _
             Select genres0.GenreID).Contains(genres.GenreID) _
            Select _
              genres.GenreID, _
              genres.Name
 
       lbGenres.DataTextField = "Name"
       lbGenres.DataValueField = "GenreID"
       lbGenres.DataSource = qry.ToList
       lbGenres.DataBind()

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 11 Apr 2011, 05:39 PM
Hi Daniel,

 This query does not seem wrong from the first sight but there is really no information for us to tell you if there is a problem and if the query is even executed against  OpenAccess of EF as mentioned in your ticket. 

Kind regards,
Zoran
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
LINQ (LINQ specific questions)
Asked by
Daniel
Top achievements
Rank 2
Answers by
Zoran
Telerik team
Share this question
or