IT DRILLDOWN
 
NEWSLETTERS
 

CIO.com updates, insights and advice on technology, management and your career.

 
 
 
LEADERSHIP
 
CIO Executive Programs
The Leader in Face-to-Face Education for Senior Executives

Offering regional and national programs, CIO (and CSO) events bring together some of the most respected names and thought leaders in information technology and security. Presented by CIOs and other senior level executives, these invitation-only programs offer timely topics and strong networking. Learn More »

 
CIO Executive Council
A Peer-Advisory Service and Professional Association for CIOs

Public Teleconferences
Join CIO Executive Council members and participate in the following live one-hour teleconferences:

* Transforming IT Teams
September 16

* Global CIOs: How to Lead on the World Stage
September 18

* Social Responsibility's Strategic Benefits
October 29

More / Register »

Learn more about the CIO Executive Council »



 
 
RESOURCE CENTER
 
 
 
SUBSCRIBE TO CIO
 
Are you involved in setting the direction for your company's IT budget or strategy?

Apply today for a FREE subscription to CIO Magazine!

 
 
 

Five Things the Boss Should Know About Microsoft's LINQ

Do you think that LINQ is just another in a long series of odd Microsoft technologies? This database-meets-software-development technology could easily save your development staff time and avoid complexity!

 

June 16, 2008CIO — You may not have heard about Microsoft's new brainchild, Language Integrated Query (LINQ). If you did hear about it, you may have yawned and put it down as yet another new technology searching for a requirement.

However, LINQ is different from most new technologies because it really can do everything it says it can. After working with LINQ for nearly a year, I've found that LINQ hasn't disappointed me, as have so many other technologies I've tried. LINQ is incredibly easy to use and quite reliable. The fact that I'm not alone in that sentiment is attested to by the large number of third-party add-ons created by other developers who feel the way I do about LINQ.

If you haven't encountered LINQ before, here's the straight-up definition. LINQ is a kind of query language, sort of the same as SQL, but the syntax is a little different. The basic idea is that you ask a question (or rather, your application does) and LINQ provides the answer from the data source you specify. That data source may not be a straight-up database. For example, if you ask LINQ which employees are in the accounting department and you supply Active Directory as the data source, the LINQ gets the answer for you from Active Directory.

Plenty has been written to explain LINQ to software developers. Here, I explain the important points for IT managers to understand.

1. Developers Can Access New Technologies Without Knowing Much About Them

A primary LINQ benefit is in reusability. A complex query you create to access objects also works with Active Directory, Microsoft SQL Server, MySQL, or a Web service; developers don't have to keep learning new techniques to use LINQ.

The basic LINQ setup comes with access for all of the data sources you might expect: data objects, SQL Server databases, XML and DataSets. However, if you stop there, you're missing LINQ's big picture. You can access a wealth of other data sources by obtaining a third-party provider—that is, LINQ add-ons, written by someone who isn't affiliated with Microsoft (and there are a ton of them). You can find common data sources, such as Active Directory, and uncommon data sources, such as Resource Description Framework (RDF).

To access data sources other than those the programming environment natively supports with most technologies, you have to jump through hoops or work through odd programming scenarios. If you make a change, a whole bunch of code usually has to change. With LINQ, you use the same query all the time. That simplifies the development process considerably, particularly for a programmer who's new to a project and hasn't made friends with the team's DBAs yet. Need a slightly techie example? Let's say, for the sake of simplicity, that you start with a C# string array like this:

String[] QueryString =
    { "One", "Two", "Three", "Four", "Five" };

To find all the strings that are more than three characters in length, you use a query like this:

var ThisQuery =
    from StringValue
    in QueryString
    where StringValue.Length > 3
    select StringValue;

In this case, ThisQuery is the output from the query process. You don't define an actual type because LINQ takes care of that for you; instead, you use var as the data type. The code uses StringValue to hold the individual data values from QueryString that match the where condition StringValue.Length > 3. The select portion of the query merely tells what to choose from the data source. Now, here's the really neat part. You can use that same query to retrieve data from an RDF or from Active Directory. If you have a provider for the data source, you can get to the data, using the same code. How cool is that?

Don't think that LINQ is limited to safe open-source projects or to Microsoft-specific data sources, either. LINQ works just fine with MySQL, as well as with a whole world of additional LINQ data sources.

You might assume that LINQ queries can't handle complex situations. The example in this section gives you a good idea where someone discovering LINQ will begin. However, LINQ queries, just like SQL queries, can become somewhat complex as you add data sources and output requirements. The learning curve to those complex queries is a gentle one, but even so, LINQ can become complex (like any other technology) as you ask it to do more work.

Loading...
 
 
ABCs
 

Just the basics, please. Sometimes we all need a refresher or we need to make sure our team and our colleagues are all on the same page.

Over 25 tutorials on everything from business intelligence to virtualization.

 
 
FEATURED SPONSORS
 
 
 
SPONSORED LINKS
 

Standalone Server vs. Open Source Toolkits

Drive More Effective Business Processes with SOA

Efficient by design: Watch this flash demo of the Quad-Core AMD Opteron Processor

HP and Oracle deploy unbreakable computing infrastructure at Replacements, Ltd.

Dell Latitude: Battery life up to 19 hours. Learn more

Video: 21st Century Networking for a 12th Century Castle

Speed, agility, flexibility - The HP BladeSystem c-Class

Learn about the software-based VoIP solution from Microsoft

Microsoft System Center - Designed For Big

Accelerating ITIL at the Service Desk

Putting Open source to the test

Weigh the trade-offs between outsourcing communications and keeping it on-premise.

Protecting Data in a Highly Networked World

Consolidation: Just the Starting Point for Virtualization

How the Mac is Becoming an IT Standard in the Enterprise

Storage Efficiency: The Key to Green Storage Operation

Oracle Real Application Testing with Oracle Database 11g

InfoWorld Test Center on Oracle Active Data Guard

Master Data Management: The Approach Determines the Results

The Power of Pervasive Business Intelligence

Reap the Benefits of Unified Communications

How to Manage the Mobile Work Environment

Extending PCI Compliance to the Mobile Workforce

Strategies for Asia-Pacific Expansion

Unified Communications: "More Than Just Talk"

Fuel the Responsive Enterprise Through Oracle Fusion Middleware

Balance Your Innovation and Efficiency Platforms for Competitive Advantage and Responsiveness

Renowned Engineering Institution Chooses AMD Processor-Based Servers

Extending the Enterprise Network Through Mobility

SOA Educational Library at the TIBCO SOA Resource Center

TDWI Report shows strong validation for investing in predictive analytics

Cost-Effective Data Center 1U Server Solutions

Secure your virtual and physical environments with the same software

GET YOUR VoIP ONTM! Win 2 Years of Hosted VoIP from Cypress. $100,000 retail value. Enter today!

Virtual Support Technology Delivers Quantifiable Gains in Productivity and Performance

File Integrity Monitoring: Secure Your Virtual & Physical IT Environments

Webcast: Roundtable discusses industry trends for Enterprise Content Management

Stimulating Innovation: Meeting IT's New Mission

The Struggle to Achieve Agility and Reduce Complexity

Maximizing Site Visitor Trust Using Extended Validation SSL

Oracle Database 11g: Real Application Testing & Manageability

InfoWorld Test Center on Oracle Real Application Testing

Oracle Database 11g: Advances in Compression, Real Application Testing and Data Guard

Getting Off on the Right Foot: Avoiding Common Master Data Management False Starts

Conquering Information Management Challenges

The Challenge of Network Access Control -- Is a Managed Service the Answer?

The Universal Wireless Client: Simplify mobility and reduce the cost of supporting mobile workers

Strategic IT Financial Management - Achieve Higher Organizational Performance

Process Integration and Traceability through Requirements Management

Building Competitive Advantage with Next-Generation Wireless Infrastructure