Entries Tagged as ‘ado.net’

February 18, 2009

SqlBuilder 2.0 – Tutorial

Overview
SqlBuilder is a class designed to make dynamic SQL tasks easier. The top design goals are:

The query should look like SQL, and all SQL queries should be possible.
SqlBuilder is about building SQL, not getting or mapping data, so it should not be bound to any particular data access implementation.

Let’s take a look at the first [...]

October 19, 2008

Linq to MySQL, based on Matt Warren’s provider

On each release Matt Warren’s IQueryable provider is getting more and more interesting. On this post I’ll show you how easy is to plug-in your custom QueryFormatter to start querying MySQL databases.
Step 1: Download Matt Warren’s provider
The code on this post is based on release 11. Although I cannot ensure it will work with newer [...]

January 3, 2008

Writing SQL using lambda expressions (not Linq)

Some of the code in this post may be outdated, I suggest visiting the project site at http://dbex.googlecode.com/
Persistence ignorance and type safety, this is what Linq gives us. I can’t get enough of the latter, but in most cases a generic query API is not what I need, specially when I’m not querying in-memory objects.
You [...]

October 29, 2007

Implementing a string.Format-like CreateCommand(string, params object[]) extension method

When first trying out Linq to Sql I was very impressed about the very simple and concise ExecuteCommand method. This method take a SQL string plus zero or more of objects that represent the values of the parameters you wish to use in the command. The cool thing is that instead of writing in the string the name of the parameters, [...]

July 31, 2007

Importance of the Provider Metadata in Linq to Sql

In this post I explain a simple way of how to take advantage of Linq to Sql for querying against any DBMS. However, today I realized that Linq to Sql was connecting to SqlServer when calling DataContext.GetCommand(). The reason is because it needed to figure out which version of SqlServer its going to get the data from, and [...]