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
Connect to a Crosstab query in Access from Excel
adprep.exe taking extremely long time
failure to convert ???
Change Required Error Message - Access 2007
unlock the "local area connection' of windows xp
How do I compute a SUM from 2 different tables and divide the Sums?
Set Word 2010 as default for .doc and .docx
Calendar Options grids
Help with formula in VBA for summing cells from two ranges into a third range
Can we enable the guest account on a machine