<p>Rails has an awesome way of looking up column names and expected datatypes from the DB, alleviating a lot of programming.</p>

<p>I'm trying to build something like this in C#.NET, because we have large tables that are ever changing. I'll be adding parameters like so:</p>

<pre><code>SqlParameter param = new SqlParameter("parametername", *SqlDbType.Int*);
param.Direction = ParameterDirection.Input;
param.Value = 0;
comm.Parameters.Add(param);
</code></pre>

<p>Notice the SqlDbType.  How can I get that?  If I get DataColumns from the DataSet, all I can get is System types like System.string.</p>

why not just let ADO.NET detect it automatically:
```
```
SqlParameter param = new SqlParameter("parametername", value);
```
```
'course, you don't actually need Direction, either:
```
```
comm.Parameters.Add(new SqlParameter("parametername",value));
```
```
I'm kind of a fan of doing things in one line :)