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
Import from Word; how to specify a particular file
SessionState
copying files from one machine to another
Error on one line and not on the other
Date Format in Windows App
How to control tabs and supress run once page in IE7 via a GPO
web site does not load right without WWW / HTaccess file not working
Access VBA - exporting a table into a text file of a different format
Is there a listing of United States zip codes that can be imported into a database
Does anyone know xls2csv and why it formats dates exactly 4 years and one day in the future? (also mathematical question)