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
Truncation of memo fields exported to Excel
how can i redirect ISA to publish a subsite on sharepoint?
Windows 7 Activation on KMS host?
Clean CRLF from text file being imported into SQL2000
DHCP on Multiple domains
Could not find part of the path
Can you change the verbage at the Top of a SSRS report
Installation of MDE and MDB in Vista
Adding a second Storage Group to Exchange 2000
vlookup between workbooks - one cell