The following code snippet will return an IEnumerable of FileInfo objects and then we can populate the DataGridView by passing the filesInfo to list the result.
Dim filesInfo = From file In files Select My.Computer.FileSystem.GetFileInfo(file)
Me.DataGridView1.DataSource = filesInfo.ToList()
Now, on running the project we can have the list of files along with the information listed in the DataGridView. With this we show how LINQ over objects in memory is used and how coding has become easier for the developers with the standard query operators traversing and retrieving over list of objects
LINQ to SQL We have seen how standard query operators can be used to access in-memory objects for a .NET project using LINQ. Now LINQ to SQL is also a component of Visual Studio 2008. It provides a platform for managing relational data as objects coupled with the ability to use query. In LINQ to SQL, the data model of a relational database is mapped to a developer-defined object model. When this is executed, LINQ to SQL translates the language-integrated queries into SQL for execution by the database, and then returns the results to the defined objects. This provides an ability to work on and manipulate the objects while LINQ to SQL working in the background tracks the changes and reflects them onto the database.
Get most out of your technology infrastructure investments with Dell
About CIOL | Media Kit | Site Map | Contact Us | Help | Write to us | Jobs@CyberMedia | Privacy Policy
Copyright © CyberMedia India Online Ltd. All rights reserved. Usage of content from web site is subject to Terms and Conditions.