Blog di Andrea Soldano

"I have a dream ..."
posts - 53, comments - 263, trackbacks - 18

My Links

News








Tag Cloud

Archives

Post Categories

I miei siti

lunedì 17 marzo 2008

Operatore Like in query LINQ

All'interno del namespace System.Data.Linq.SqlClient è presente un classe helper denominata SqlMethods che puo' rivelarsi utile nella costruzione di query con l'operatore SQL "Like".

var query = from c in ctx.Customers
            where SqlMethods.Like(c.City, "L_n%")
            select c;

Lo statement qui sopra genera un query del tipo:

SELECT CustomerID, CompanyName, ...
FROM    dbo.Customers
WHERE  City LIKE [L_n%]

posted @ lunedì 1 gennaio 0001 00:00 | Feedback (4) |

Powered by:
Powered By Subtext Powered By ASP.NET