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
Path To File Is Truncated...Can I Show The Full Path
Access Table structure...
Import a CSV file to multiple tables
Distributing an Excel Add-In
Cannot uninstall Exchange 2010 Hub transport role of previously deleted 2008 R2 server
SBS2008 Error 50331656 Remote Desktop
Great Plains 10 Custom Report - Multiple Comanies different form layout
Using Workbook.SaveAs in Access with VBA generates Error 1004???
Common.Logging and Log4Net.xml file not found issue
IAS Service Stoping with Member Not Found error.