Microsoft
Software
Hardware
Network
Question : Convert LINQ in C# to VB.NET
Hi all,
I am converting some code from C# to VB.NET but I'm having some trouble with LINQ.
The following is a line a code I wish to convert:
var page = db.Pages.Single
(p => p.ID == NewPageId);
After converting I get the following line:
Dim page = db.Pages.[Single](Of Page)(Function(p) p.ID = NewPageId)
Whe I do this I get the following error:
Overload resolution failed because no accessible 'Single' accepts this number of type arguments.
Any help is greatly appreciated!
Thank you.
Answer : Convert LINQ in C# to VB.NET
it is because two curly braces, remove one
public static void main(String[] args){
{ //REMOVE THIS
Random Solutions
Textboxes in other Tabs in asp.net
RUNDLL error message "jyku.fjo" on computer start up
Access Pivot chart - need different scales on right and left axis
active directory, W2k8 R2 DC, Kerberos failures, Event ID: 3, 4771, 4769, 4768, 4776, 4625 source: Microsoft Windows security
Problem with "like" keyword, when database is in chinese
VS2008 opens .aspx files in new IE window instead of Designer/Source Editor
Pass Web Page as Parameter to Class in App_Code Folder
How to create a non-scrolling section (menu) of a web page
Opening Organization chart with open office
VBA - Playing Movies using VLC or GOM Player