Archive for the 'LINQ' Category

IN queries with LINQ to SQL

This is another awesome feature in LINQ to SQL that i always forget about. Sometimes you have an array of strings or any other type and want to query the database for all values that have one of the values in the array. string platform = “windows|linux”; string[] platformList = platform.Split(‘|’); itemQuery = from m [...]

Join and Group By with LINQ to Entities

I have banged my head against some LINQ to Entities stuff today. It started out when i was doing a query to get some stats out of my forum. I should point out that i’m a newbe with LINQ to Entities and the Entity Framework so if i have done anything stupid here you are [...]

Group By with LINQ

Today i wanted to do a group by query with LINQ wich is something i never done before. I turned out to be kind of easy. If you just want to group by a single field. (from s in db.CrewStatsSet where s.LogDate >= date1 && s.LogDate <= date2 && s.Action == action group s by [...]

Create a tag cloud with limited amout of tags in ASP.NET and LINQ

Today i built a Tag cloud for my new site. I found this great article about on how to do it with LINQ and C#. But i missed some features. Especially how to limit the number of tags that was shown. So if you read that article and then have a look at this code [...]

LINQ to SQL and the XML datatype

Today i have done some stuff with LINQ to SQL and the xml data type from SQL Server 2005. I had some problem finding information about this and spent some hours figuring out how the insert/update/delete worked. Post a comment if you find something I’ve done wrong. This is mostly for my own reference. Get [...]