Showing posts with label integer. Show all posts
Showing posts with label integer. Show all posts

Monday, March 12, 2012

Question on parameter.Add for an SQL Insert

I'm trying to update my database table from my dataset.

In the following statement, the ? represents the "size as integer" of the SqlDbType of DateTime and I can't fiqure out what to put there.

command.Parameters.Add("@.ItemDate", SqlDbType.DateTime, ?,"ItemDate")

In the following statement I understand the "50" since it is the size of the field, but I don't understand what to do with the DateTime.

command.Parameters.Add("@.ItemText", SqlDbType.NVarChar, 50, "ItemText")

Thank you for your help

This chart might help:

http://www.carlprothman.net/Technology/DataTypeMapping/tabid/97/Default.aspx

Buck Woody

Question on parameter.Add for an SQL Insert

I'm trying to update my database table from my dataset.

In the following statement, the ? represents the "size as integer" of the SqlDbType of DateTime and I can't fiqure out what to put there.

command.Parameters.Add("@.ItemDate", SqlDbType.DateTime, ?,"ItemDate")

In the following statement I understand the "50" since it is the size of the field, but I don't understand what to do with the DateTime.

command.Parameters.Add("@.ItemText", SqlDbType.NVarChar, 50, "ItemText")

Thank you for your help

This chart might help:

http://www.carlprothman.net/Technology/DataTypeMapping/tabid/97/Default.aspx

Buck Woody