Click here to Skip to main content
15,905,325 members
Home / Discussions / C#
   

C#

 
QuestionKeys shortcuts problem Pin
Tavbi2-Nov-06 1:19
Tavbi2-Nov-06 1:19 
AnswerRe: Keys shortcuts problem Pin
luckykhalid2-Nov-06 1:29
luckykhalid2-Nov-06 1:29 
GeneralRe: Keys shortcuts problem Pin
Martin#2-Nov-06 1:31
Martin#2-Nov-06 1:31 
GeneralRe: Keys shortcuts problem Pin
Tavbi3-Nov-06 1:21
Tavbi3-Nov-06 1:21 
GeneralRe: Keys shortcuts problem Pin
Tavbi3-Nov-06 1:28
Tavbi3-Nov-06 1:28 
AnswerRe: Keys shortcuts problem Pin
Martin#7-Nov-06 1:32
Martin#7-Nov-06 1:32 
GeneralRe: Keys shortcuts problem Pin
Tavbi8-Nov-06 4:15
Tavbi8-Nov-06 4:15 
QuestionLinq - Problems with conversion [modified] Pin
Storme2-Nov-06 1:05
Storme2-Nov-06 1:05 
Excuse me for being brief, but it is self explanatory.

So I make a query with linQ, and then try to make a 2nd query on the previous results, but there i get an error.

            List<clsHotel> q = from d in dbGet.Hotels()  // dbGet.Hotels() returns List<clsHotel><br />
                    select d;<br />
<br />
            if (chkHalfpension.Checked) {<br />
                List<clsHotel> z = from x in q     // Error occures here on q<br />
                                            where x.Naam == "Bon jour"   <br />
                                            select x;<br />
            }


It returns the following error on that line:

Error 1 Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<hotelmanager.data.clshotel>' to 'System.Collections.Generic.List<hotelmanager.data.clshotel>'. An explicit conversion exists (are you missing a cast?)


If anyone could please help.

Thanks in advance !

-- Edit --

The weird thing is:

This code also doesnt works:


List<clsHotel> q = from d in dbGet.Hotels()  // dbGet.Hotels() returns List<clsHotel><br />
                    select d;<br />
<br />
                List<clsHotel> z = from vx in dbGet.Hotels()   // also gives error here<br />
                                   select vx;


It throws the same error, but the code is the same :s
Guess it's an bug in c#3.0 ?

-- modified at 8:18 Thursday 2nd November, 2006
AnswerRe: Linq - Problems with conversion Pin
ednrgc2-Nov-06 6:27
ednrgc2-Nov-06 6:27 
GeneralRe: Linq - Problems with conversion Pin
Storme2-Nov-06 6:52
Storme2-Nov-06 6:52 
GeneralRe: Linq - Problems with conversion Pin
ednrgc2-Nov-06 6:55
ednrgc2-Nov-06 6:55 
GeneralRe: Linq - Problems with conversion Pin
Storme2-Nov-06 7:05
Storme2-Nov-06 7:05 
GeneralRe: Linq - Problems with conversion Pin
ednrgc2-Nov-06 6:59
ednrgc2-Nov-06 6:59 
QuestionChanging a Color on the fly Pin
Gareth H2-Nov-06 0:53
Gareth H2-Nov-06 0:53 
AnswerRe: Changing a Color on the fly Pin
Martin#2-Nov-06 1:06
Martin#2-Nov-06 1:06 
QuestionUsing a struct passed from a C# web service at the client Pin
jvink2-Nov-06 0:26
jvink2-Nov-06 0:26 
AnswerRe: Using a struct passed from a C# web service at the client Pin
luckykhalid2-Nov-06 1:20
luckykhalid2-Nov-06 1:20 
QuestionDirectory from File Name Pin
Jon Hulatt2-Nov-06 0:22
Jon Hulatt2-Nov-06 0:22 
AnswerRe: Directory from File Name Pin
J4amieC2-Nov-06 0:24
J4amieC2-Nov-06 0:24 
GeneralRe: Directory from File Name Pin
Jon Hulatt2-Nov-06 0:28
Jon Hulatt2-Nov-06 0:28 
AnswerRe: Directory from File Name Pin
Guffa2-Nov-06 0:27
Guffa2-Nov-06 0:27 
Questionthinning of a image Pin
s4_sabahatf2-Nov-06 0:18
s4_sabahatf2-Nov-06 0:18 
AnswerRe: thinning of a image Pin
ednrgc2-Nov-06 6:29
ednrgc2-Nov-06 6:29 
GeneralRe: thinning of a image Pin
s4_sabahatf3-Nov-06 21:13
s4_sabahatf3-Nov-06 21:13 
GeneralRe: thinning of a image Pin
ednrgc6-Nov-06 2:39
ednrgc6-Nov-06 2:39 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.