Wrox Programmer Forums
|
ASP.NET 4.5.1 General Discussion For ASP.NET 4.5.1 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4.5.1 General Discussion section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 10th, 2015, 03:51 AM
Authorized User
 
Join Date: Nov 2010
Posts: 63
Thanks: 3
Thanked 0 Times in 0 Posts
Default Getting records with LINQ

Hello
I'm trying to get the records of a SQL view with LINQ. Then I want to iterate through all records (for each....next) and perform an action. I want to query the view depending on a condition (for example all records or only those with name "Brown").
Name of view: view_users
Name of entity: myentities
I'm struggling defining the correct type (DIM users as ????) and how I have to get the list of users with all columns.
If x=1 then
users=from r in myentities.view_users where name=Brown
else
users=from r in myentities.view_users
end if
for each users in ????
next
I know that this is not the correct syntax. I'm sure that it's quite simple, I just don't know how to do it.
Any help?
Thanks
Alexander Avidan





Similar Threads
Thread Thread Starter Forum Replies Last Post
LINQ to EF and LINQ to SQL sophia BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 19th, 2011 12:16 PM
LINQ vaibhavgoe LINQ 4 December 21st, 2009 03:49 PM
Inserting D.B. records programatically ( entering the same value in all records ? ) liamfitz BOOK: Visual Basic 2008 Programmer's Reference ISBN: 978-0-470-18262-8 0 June 22nd, 2009 03:44 PM
problem in updating records & finding records naveed77 VB Databases Basics 1 January 16th, 2007 12:12 PM
problem in updating records & finding records naveed77 VB How-To 1 January 16th, 2007 12:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.