Note that there are some explanatory texts on larger screens.

plurals
  1. POLing-to-SQL Compiler Error When Creating Dictionary
    primarykey
    data
    text
    <p>I'm trying to develop a simple WP7 database app which uses Linq2SQL to query the database, but today I managed to received an internal compiler error :(</p> <p>A simplified version of my query is below (<code>Results</code> is a class which holds my search results data):</p> <pre><code>var query = ( from x in MyTable join y in MyOtherTable on x.Key equals y.Key where SqlMethods.Like(x.Field, "%" + searchTerm + "%") select new Results { MyResultField = new Dictionary&lt;MyEnum,string&gt;() { { MyEnum.Value, x.Field }, { MyEnum.OtherValue, y.Field } }, ... } ); </code></pre> <p>However, trying to create a new <code>Dictionary</code> like this results in a raft of compiler errors, even though IntelliSense doesn't object. I've searched around, but I'm not sure how to achieve a similar result without trying to create a <code>Dictionary</code> at this point.</p> <p>Any ideas for a hopeless newbie?! Many thanks in advance!</p> <p><strong>Update</strong></p> <p>Sorry, I forgot to include the compiler errors. Apart from #6, they're gibberish to me, but if it helps ...</p> <pre><code># Error 1 Internal Compiler Error: stage 'BEGIN' MyProject # Error 2 Internal Compiler Error: stage 'EMIT' MyProject # Error 3 Internal Compiler Error: stage 'COMPILE' MyProject # Error 4 Internal Compiler Error: stage 'COMPILE' C:\...\ViewModel.cs MyProject # Error 5 Internal Compiler Error: stage 'COMPILE' symbol '&lt;global namespace&gt;' C:\...\ViewModel.cs MyProject # Error 6 Internal Compiler Error (0xc0000005 at address 681AB648): likely culprit is 'BIND'. # An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the program near the locations listed below. Locations at the top of the list are closer to the point at which the internal error occurred. Errors such as this can be reported to Microsoft by using the /errorreport option. # MyProject # Error 7 Internal Compiler Error: stage 'COMPILE' symbol 'ChineseClassmate' C:\...\ViewModel.cs 12 11 MyProject # Error 8 Internal Compiler Error: stage 'COMPILE' symbol 'ChineseClassmate.MyProject' C:\...\ViewModel.cs 12 11 MyProject # Error 9 Internal Compiler Error: stage 'COMPILE' symbol 'ChineseClassmate.MyProject.ViewModel' C:\...\ViewModel.cs 12 11 MyProject # Error 10 Internal Compiler Error: stage 'COMPILE' symbol 'MyProject.ViewModel.MyProjectViewModel' C:\...\ViewModel.cs 17 15 MyProject # Error 11 Internal Compiler Error: stage 'COMPILE' symbol 'MyProject.ViewModel.MyProjectViewModel.SearchDatabase(string)' C:\...\ViewModel.cs 57 15 MyProject # Error 12 Internal Compiler Error: stage 'COMPILE' symbol 'MyProject.ViewModel.MyProjectViewModel.SearchDatabase(string)' C:\...\ViewModel.cs 57 15 MyProject # Error 13 Internal Compiler Error: stage 'COMPILE' symbol 'MyProject.ViewModel.MyProjectViewModel.SearchDatabase(string)' C:\...\ViewModel.cs 57 15 MyProject # Error 14 Internal Compiler Error: stage 'BIND' symbol 'MyProject.ViewModel.MyProjectViewModel.SearchDatabase(string)' C:\...\ViewModel.cs 57 15 MyProject </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload