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
Random numbers in VB.net not random...weird?
Keyboard input in Dialog box MFC
Modifying the unattend.xml file to add CopyProfile
How do I create an automatic counter in MSWord?
Log of remote web workplace usage - track past user activity?
Synchronize Outlook with Access Contact Manager
Proxy Server 2.0 and Quake 3
create a access database with information from a spreadsheet and print to index cards
UNION IN SUBQUERY - MS ACCESS
How to enable hibernate acpi in xp 64 bit on dell optiplex 760