I was just reading a question about how to add parameters to a SqlCommand in .NET, and it raised a question for me. In all of my programs, this is how I add parameters to m
here is my way
cmd.InjectFrom(foo);
all the properties foo (I sometimes use anonymous, and you can also specify ignores ) are going to be AddWithValue to the cmd, and for null DBNull.Value is going to be set
I recommend you too look at samples project from here http://valueinjecter.codeplex.com/ (it contains DAL sample)