我試圖開發一種使用LINQ2SQL查詢數據庫,一個簡單的WP7應用程序的數據庫,但今天我設法收到內部編譯器錯誤:(靈到SQL編譯器錯誤當創建字典
簡化我查詢的版本是低於(Results
是保存我的搜索結果數據的類):
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<MyEnum,string>()
{
{ MyEnum.Value, x.Field },
{ MyEnum.OtherValue, y.Field }
},
...
}
);
但是,試圖創建一個新的Dictionary
這樣會導致編譯器錯誤的木筏,即使IntelliSense不對象我已經搜索過了,但我不確定如何在不嘗試創建01的情況下實現類似的結果在這一點上。
任何想法爲無望的新手?提前謝謝了!
更新
對不起,我忘了,包括編譯器錯誤。除了#6,他們對我來說是胡言亂語,但如果它有幫助...
# 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 '<global namespace>' 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
「一個內部編譯器錯誤」。 「大量的編譯器錯誤」。對於任何人來診斷你的問題都會非常棘手,除非你正確地告訴我們*那些編譯錯誤是什麼! – LukeH
對不起盧克,你是對的!我已經添加了上面的錯誤。 – Superangel