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
msaccess 2003 and turning on a new menu toolbar from module code and turning off the main menu from the same place
Problem with Joomla email cloaking
can i use right([ClientName] to get the last part of a string in a Microsoft Access query if i don't know how long the last part is?
How can I print using a Clipper (DOS) application under Windows 7
last month and week data set
Setting the Scroll bars in the Report Viewer Control
How to enable/disable a succeeding dropdown list if a value is selected on the first drop down list
How to Create an On Key Press Event in Visual Studio 2005
Simple SQL Join Query Syntax Issue
CToolBar derived Toolbar repositioning