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
I need to capture the output of the datagrid grdAttendees and record each Members Email Address.
what to key do you press to restore an EMACHINE 3646
Tape Drive not reconized in Windows Explorer
ISA 2006 - 12202 The ISA Server Denied the specified Uniform Resource Locator (URL)
Is it possible to open a files and folders selection box?
Excessive paging and perfmon showing pages/sec peaking at 2400
Merging xfdf data into pdf with Internet Explorer Doesnt work
"IFMEMBER" command error in logon scripts. HELP!!!!!!!!!!!!!!
Attach Text Box and Combo Box text
add ALL in combobox rowsource query