Impact of Gen-AI on IT Jobs - Growth Mindset Show
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
4
Reply
Why , "SELECT" after "FROM" in LINQ ?
Nakul Chaudhari
11y
2.9k
1
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
check this url: http://www.codeproject.com/Articles/19154/Understanding-LINQ-C
Prakash Lakshmanan
10y
0
Not really sure how your quadupuled posted, but I think have seen you previously double posted. Be careful with the submit button, let the page load after you click it. It is annoying and inconsistant have multiple posts for the same topic.See the following links.http://msdn.microsoft.com/en-us/library/bb383978.aspxhttp://msdn.microsoft.com/en-us/library/bb384087.aspxAlthough the linq syntax is similar to SQL it can be used completely without SQL. The "from clause" starts the expression tree, selects the datasource, and declares the local ranged variable for each element. It is more similar to "foreach". In order to get your range variable hard typed you need to put that before your query. It is similar to "SELECT * FROM Table AS [LocalVariable]".Scheme and Lisp were very very early (maybe even the first) programming languages. They are very fast, but hard to understand. This is due to the order of which you must write your procedures. SQL uses the Scheme syntax, but different functionality. The LINQ syntax reordered the sql structure which I find more in order of writing an query. At first it was hard, but after I memorized the syntax I can write it alot faster than SQL.Other than that the layout may also have to do with the expression tree it creates. DataContext dc = new DataContext;//LINQ Syntax var results = (from row in dc.Table where row.IsValid select row.Id).ToList();//Is the same as Methods Syntax var results2 = dc.Table.Where(row => row.IsValid). Select(row => row.Id).ToList();
Vithal Wadje
11y
0
interesting question agreed with Murugesh.
Anupam Singh
11y
0
The reason is, LINQ is used with C# or other programming languages, which requires all the variables to be declared first. From clause of LINQ query just defines the range or conditions to select records. So that's why from clause must appear before Select in LINQ
Murugesh P
11y
0
Message