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
The specific error is:0x8007052e: Logon failure: unknown user name or bad password. Verify that the task's Run-as name and password are valid and try again."
SQL Query
Access 2003 Macro Question: How to set focus to a specific tab on a tab control within an existing macro?
Receiving error when submitting data to SQL Server through asp.net vb
Access 2000 Relink front-end to back-end tables using a path supplied by an .ini file
Need to update first booking of the day for each person within a time period
Import HTML into Outlook 2007
Input masks for numerical data?
Reader.GetString Receives Conversion Error in vb.net
Pivot Table: Export to a CSV file