Home All Groups Group Topic Archive Search About
Author
7 Dec 2006 12:38 PM
KShvats
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

Author
7 Dec 2006 12:52 PM
Otis Mukinfus
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
Author
7 Dec 2006 1:09 PM
KShvats
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
Author
7 Dec 2006 3:39 PM
Yves. L.
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

AddThis Social Bookmark Button