SQLDBType.date

R

rbrowning1958

Hello,

Trying to compile some code I was given. Vs 2005 patches applied
AFAICT. Help / About reports visual studio versiopn 8.0.50727.867 and
framework version 2.0.50727.

Code references SqlDbType.date and receives compilation error that the
enumeration does not contain a definition for Date. I looked at the
definition and sure enough my enumeration ends with:

// Summary:
// A SQL Server 2005 user-defined type (UDT).
Udt = 29,

Colleague's machine shows the enumeration with 5 additional values
including Date. What's up with this?

Cheers

Ray
 
J

Jon Skeet [C# MVP]

rbrowning1958 said:
Trying to compile some code I was given. Vs 2005 patches applied
AFAICT. Help / About reports visual studio versiopn 8.0.50727.867 and
framework version 2.0.50727.

Code references SqlDbType.date and receives compilation error that the
enumeration does not contain a definition for Date. I looked at the
definition and sure enough my enumeration ends with:

// Summary:
// A SQL Server 2005 user-defined type (UDT).
Udt = 29,

Colleague's machine shows the enumeration with 5 additional values
including Date. What's up with this?

It looks to me like it's part of .NET 2.0 SP1 - try installing that and
rebuilding.
 
R

rbrowning1958

It looks to me like it's part of .NET 2.0 SP1 - try installing that and
rebuilding.

Hello,

Thanks for the reply. I've found the issue - SqlDbType.date is only
defined for framework 3.5, which I don't have installed but colleague
does. We're both using VS 2005 but he also has 2008 installed which I
don't.

Cheers

Ray
 
J

Jon Skeet [C# MVP]

rbrowning1958 said:
Thanks for the reply. I've found the issue - SqlDbType.date is only
defined for framework 3.5, which I don't have installed but colleague
does. We're both using VS 2005 but he also has 2008 installed which I
don't.

Are you sure it's in 3.5 rather than 2.0SP1? That would surprise me, to
be honest, given the way the assemblies are laid out etc. (Installing
3.5 also installs 2.0SP1.)
 
F

Fred

Dans : Jon Skeet [C# MVP] disait :
Are you sure it's in 3.5 rather than 2.0SP1? That would surprise me,
to be honest, given the way the assemblies are laid out etc.
(Installing
3.5 also installs 2.0SP1.)

Yes, these values only appear in .NET 3.5 (in MSDN library).
I guess they can be used only with SQL Server 2008 (new date and time
types).
 
J

Jon Skeet [C# MVP]

Fred said:
Yes, these values only appear in .NET 3.5 (in MSDN library).
I guess they can be used only with SQL Server 2008 (new date and time
types).

Can anyone who has .NET 2.0SP1 but not .NET 3.5 installed actually
confirm this? You see, I was under the impression that .NET 3.5 only
*added* assemblies rather than modifying existing ones - whereas
..NET 2.0 SP1 replaces the .NET 2.0 assemblies.

SqlDbType exists in a .NET 2.0 assembly, hence I would expect the
addition to be part of .NET 2.0SP1.

I've got a 2.0-only VM which I'll back up and then install 2.0SP1 on to
check...
 
J

Jon Skeet [C# MVP]

I've got a 2.0-only VM which I'll back up and then install 2.0SP1 on to
check...

Okay, I've just checked, and indeed SqlDbType.Date *is* available on
..NET 2.0SP1. You don't have to install .NET 3.5.
 
F

Fred

Dans : Jon Skeet [C# MVP] disait :
Can anyone who has .NET 2.0SP1 but not .NET 3.5 installed actually
confirm this? You see, I was under the impression that .NET 3.5 only
*added* assemblies rather than modifying existing ones - whereas
.NET 2.0 SP1 replaces the .NET 2.0 assemblies.

I would think the same.
SqlDbType exists in a .NET 2.0 assembly, hence I would expect the
addition to be part of .NET 2.0SP1.

I've got a 2.0-only VM which I'll back up and then install 2.0SP1 on
to check...

Some informations about my dll (with 3.5 installed)
version 2.0.50727.1433
size 2,89 Mb (3 036 160 bytes)
last modified 24 oct 2007, 02:47:40

And reflector tells me :
'' Module System.Data.dll
Version:77dc95c1-9ba5-423b-90d1-24aef4cf8492
Location:%SystemRoot%\Microsoft.net\Framework\v2.0.50727\System.Data.dll
Size:3036160 Bytes
 
R

rbrowning1958

Okay, I've just checked, and indeed SqlDbType.Date *is* available on
.NET 2.0SP1. You don't have to install .NET 3.5.

John,

I'm eating my words - I think are correct. The MSDN documentation
implies that this is only available in 3.5, but others have this
working with the 2.0 framework. I am going to reapply the 2.0 SP1 and
see what happens.

Thanks

Ray
 
J

Jon Skeet [C# MVP]

rbrowning1958 said:
I'm eating my words - I think are correct. The MSDN documentation
implies that this is only available in 3.5

Whereabouts, out of interest? I looked earlier, but I couldn't see any
such implications - I may just have been looking in the wrong place. If
it *does* say that, we should fire off a correction...
, but others have this
working with the 2.0 framework. I am going to reapply the 2.0 SP1 and
see what happens.

:)
 
R

rbrowning1958

Whereabouts, out of interest? I looked earlier, but I couldn't see any
such implications - I may just have been looking in the wrong place. If
it *does* say that, we should fire off a correction...


:)

Jon,

I got to the bottom of my issue and I've been a bit of a plonker.

1. I was repeatedly patching Visual studio - not the framework - duh!
2. When I did finally figure this out and got the framework patch, it
told me it wouldn't run on Vista.
3. I read somewhere I had to install 3.5 and this will also update 2.0
to 2.1 which it did successfully. And now my code compiles.

RE the documenthation - look here:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/html/
T_System_Data_SqlDbType.htm

There's no mention of the Date value for the enumeration. I did see it
somewhere listed for 3.5 I'm sure but can't find it now - maybe it was
a dream.

Cheers

Ray
 
J

Jon Skeet [C# MVP]

rbrowning1958 said:
I got to the bottom of my issue and I've been a bit of a plonker.

1. I was repeatedly patching Visual studio - not the framework - duh!
:)

2. When I did finally figure this out and got the framework patch, it
told me it wouldn't run on Vista.

That's strange. Not sure why that would be the case. Ah well :)
3. I read somewhere I had to install 3.5 and this will also update 2.0
to 2.1 which it did successfully. And now my code compiles.

Right. Just for pedantry, it's 2.0SP1 rather than 2.1. I can't imagine
that Microsoft would release a 2.1 now, but it's just *possible*.
RE the documenthation - look here:

ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/cpref4/html/
T_System_Data_SqlDbType.htm

There's no mention of the Date value for the enumeration. I did see it
somewhere listed for 3.5 I'm sure but can't find it now - maybe it was
a dream.

That's probably the vanilla 2.0 documentation - see if it mentions the
DateTimeOffset structure, which is also new in 2.0SP1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top