11          C# Scripting

The Language Integrated Query - LINQ is a Microsoft .NET Framework technology that adds native data querying capabilities to .NET languages. LINQ enables developers to form set-based queries in their application code, without having to use a separate query language. You can write LINQ queries against various enumerable data sources, such as in-memory data structures, XML documents, SQL databases, and DataSet objects. Although these enumerable data sources are implemented in various ways, they all expose the same syntax and language constructs. Because queries can be formed in the programming language itself, you do not have to use another query language (like SQL) that is embedded as string literals that cannot be understood or verified by the compiler.

 

There are three separate ADO.NET Language-Integrated Query (LINQ) technologies: LINQ to DataSet, LINQ to SQL, and LINQ to Entities. LINQ to DataSet provides richer, optimized querying over the DataSet and LINQ to SQL enables you to directly query SQL Server database schemas, and LINQ to Entities allows you to query an Entity Data Model.

The following diagram provides an overview of how the ADO.NET LINQ technologies relate to high-level programming languages and LINQ-enabled data sources.

 

image

 

LINQ Query editor is an innovative feature and can run dynamically LINQ Query scripts. It supports currently LINQ to Entities (Entity Framework), LINQ to DataSet, LINQ to Objects and LINQ to XML queries. The LINQ query feature is currently supported for MS SQL Server, IBM DB2, MySQL, PostgreSQL, SQLite, FireBird, EffiProz database engines. Support for Oracle, MongoDB and Informix engines will be implemented soon.

 

LINQ to SQL technology for SQL Server is not supported.

 

11.1Result Output

After executing the query script, you can dump the results using Output method. The Dump method detects automatically the given object list and visualize the data as a table or a tree view.

 

11.2Linq to DataSet

Database Master allows you to execute Linq to DataSet code against any database system. LINQ to DataSet makes it easier and faster to query over data cached in a DataSet object. Specifically, LINQ to DataSet simplifies querying by enabling developers to write queries from the programming language itself, instead of by using a separate query language. This is especially useful for Microsoft Visual Studio developers, who can now take advantage of the compile-time syntax checking, static typing.

 

LINQ to DataSet can also be used to query over data that has been consolidated from one or more data sources. This enables many scenarios that require flexibility in how data is represented and handled, such as querying locally aggregated data and middle-tier caching in applications.

 

The LINQ to DataSet functionality is exposed primarily through the extension methods in the DataRowExtensions and DataTableExtensions classes. 

 

 

 

For more help:

LINQ Basic Info:         http://en.wikipedia.org/wiki/Language_Integrated_Query

LINQ to Entities:         http://msdn.microsoft.com/en-us/library/bb399367.aspx

LINQ to XML:              http://msdn.microsoft.com/en-us/library/bb387098.aspx

LINQ to DataSet:        http://msdn.microsoft.com/en-us/library/bb386977.aspx

LINQ to Objects:        http://msdn.microsoft.com/en-us/library/bb397919.aspx

 

 


powered by Nucleon Software