|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SqlDbTypesHey there
I have problems creating SqlParameters - 1) Could not find a table with C# counterparts to all SqlDbTypes(e.g. do i use float or double for SqlDbType.Float); 2) How do i find the size of column on the SQL server(what is the size of decimal(11, 2) ) TNX On Thu, 07 Dec 2006 14:38:19 +0200, KShvats <z@z.z> wrote:
>Hey there I don't know where you can find a cross reference between the data types. I too> >I have problems creating SqlParameters - 1) Could not find a table with >C# counterparts to all SqlDbTypes(e.g. do i use float or double for >SqlDbType.Float); 2) How do i find the size of column on the SQL >server(what is the size of decimal(11, 2) ) > >TNX could not find it, but the size is not a problem. If you use the SqlParameter.AddWithValue("@Param", somevalue) method ADO.NET will figure it out for you. Good luck with your project, Otis Mukinfus http://www.arltex.com http://www.tomchilders.com Thank you for the quick answer, the size is my main problem - to use
Prepare() with an SQL command you have to provide size, plus as far as I understand there is a huge performance advantage when the size is provided. Otis Mukinfus wrote: Show quote > On Thu, 07 Dec 2006 14:38:19 +0200, KShvats <z@z.z> wrote: > >> Hey there >> >> I have problems creating SqlParameters - 1) Could not find a table with >> C# counterparts to all SqlDbTypes(e.g. do i use float or double for >> SqlDbType.Float); 2) How do i find the size of column on the SQL >> server(what is the size of decimal(11, 2) ) >> >> TNX > > I don't know where you can find a cross reference between the data types. I too > could not find it, but the size is not a problem. If you use the > SqlParameter.AddWithValue("@Param", somevalue) method ADO.NET will figure it out > for you. > Good luck with your project, > > Otis Mukinfus > http://www.arltex.com > http://www.tomchilders.com Hi, here are some tables with the mappings you need
http://msdn2.microsoft.com/en-us/library/system.data.sqltypes.aspx http://www.carlprothman.net/Default.aspx?tabid=97
Other interesting topics
|
|||||||||||||||||||||||