***** Disclaimer ****** I may be the last person to figure this out, but oh well. ***** End Disclaimer ****** Today as I was further exploring the coolness that is Linq to Sql I ran into a little situation. I was creating a query where I wanted to use the columns form multiple tables to build an...
If you have not taken a look at Linq (either Linq to objects or Linq to sql) you need to do so. I would say it is the coolest new feature that was released with .Net 3.5. But there is one thing that you MUST keep in mind when using Linq. It has been designed to perform lookups using...
From the time that I started learning about C# 3.0 and LINQ I've had a number of interesting ideas spinning about in my head. Last week I finally got some free time to work them out. I'm pretty excited about the results. Essentially I wanted a way to make queries work better within...
Again, this post is another in the recent string of How-to's. But it is just so hard to resist. .Net 3.5 has so many cool features, it is just fun to explore them all. In today's post I thought it would be fun to use Linq to access the file system. I thought I would show how to query both for...
This post is another in the recent string of How-to's. But it is just so hard to resist. .Net 3.5 has so many cool features, it is just fun to explore them all. Ok, so here is the issue we are going to solve today. We have a list of entities and we need to sort them. In this post I will show you...
Ok, I am only a few days into using Linq and I am already getting annoyed. I have a need to create an abstract base class that will have a few common properties (columns) that will be used by all my inherited classes. Here is what I WAS wanting to do. public abstract class StagedUserInformation { [Column...
Can someone help me with this? I was trying to insert a record into our DB where the data type was a TinyInt and received this error "The primary key column of type 'TinyInt' cannot be generated by the server. ". I did a bit of Googling and found one post where it states the Linq does...
In my last post ( here ) I raised the question as to how to create the DTO/DataContext to be used when using Linq2Sql. I had some free time so I thought I would do some speed tests to see if there was any speed differences between the various ways to use Linq2Sql. Boy was I shocked by what I found. Here...
Today I started to play/learn the basics on Linq2SQL and I have to say, it is pretty cool. However, within the first 20 minutes I came to a cross roads, I was stuck. I am torn between the 2 different ways to connect to, and query from, a data source. I don't know which I like better. Below are the...
This is my first go at playing with Linq. So far it is pretty cool, but I wanted to share something because I found it painful. I wanted query a list and then cast a anonymous type to a static type. I was not able to find anything on the net to help me with this (could be i just did not look in the right...