Linq Like SqlMethods

Posted on: Thu Nov 05 15:34:43 -0800 2009. Updated on: Thu Nov 05 15:36:26 -0800 2009.
Category: DotNet

Sql methods are a neat tool inside of linq. They allow you to do typical functions we are used to from sql but nicely built into linq. They are found under: using System.Data.Linq.SqlClient;

// Example where dc is DataContext
var query = from u in dc.Users
            where SqlMethods.Like(u.UserName, "%johnny%")
            select u;

Comments:

Add a Comment:

simple_captcha.jpg
(human authentication)


Ads

Categories

About

Random foliage

This website is meant to be a reference for ASP Dot Net developers. The entries are a compilation of things I've figured out how to do and that I deem useful to keep of track for future reference. Assumptions: web development with: C Sharp (vb sucks), visual studio 05/08, .net 3.5, meant for programmers. Written by: James Reategui.