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
Short words in MSSQL full text search. Need them included!
Can not register DNS for new 2003 domain controller. Using infoblox appliance for dns.
Microsoft Great Plains V10 Compliant to SOX
Determining the application folder at runtime (VB.NET)
How to access CD-ROM/Audio of Thin Client Device after login to Microsoft Terminal Server?
is there a difference between C++ in visual studio 2008" and "visual C++ 2008"
Data Grid Control in MFC
ORDER BY in UNION query that contains both text and numbers
Error: (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe
The "Set Value' Macro action cannot be run in disable mode. in MS Access 2007