SQLDBType.date

SQLDBType.date

am 01.04.2008 11:21:53 von 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

Re: SQLDBType.date

am 01.04.2008 11:37:17 von skeet

rbrowning1958 wrote:
> 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.

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: SQLDBType.date

am 01.04.2008 11:56:45 von rbrowning1958

On Apr 1, 10:37=A0am, Jon Skeet [C# MVP] wrote:
> rbrowning1958 wrote:
> > 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:
>
> > =A0 =A0 =A0 =A0 =A0// Summary:
> > =A0 =A0 =A0 =A0 // =A0 =A0 A SQL Server 2005 user-defined type (UDT).
> > =A0 =A0 =A0 =A0 Udt =3D 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.
>
> --
> Jon Skeet - http://www.pobox.com/~skeet=A0 Blog:http://ww=
w.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

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

Re: SQLDBType.date

am 01.04.2008 12:24:22 von skeet

rbrowning1958 wrote:
> 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.)

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: SQLDBType.date

am 01.04.2008 13:32:48 von Fred

Dans : news:MPG.225c1daf3e82f687c22@msnews.microsoft.com,
Jon Skeet [C# MVP] disait :
> rbrowning1958 wrote:
>> 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.)

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).

--
Fred
foleide@free.fr

Re: SQLDBType.date

am 01.04.2008 13:46:00 von skeet

Fred wrote:
> > 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).

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...

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: SQLDBType.date

am 01.04.2008 14:11:15 von skeet

Jon Skeet [C# MVP] wrote:



> 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.

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: SQLDBType.date

am 01.04.2008 14:14:21 von Fred

Dans : news:MPG.225c30ca4b8202acc27@msnews.microsoft.com,
Jon Skeet [C# MVP] disait :
> Fred wrote:
>>> 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).
>
> 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\Sys tem.Data.dll
Size:3036160 Bytes


--
Fred
foleide@free.fr

Re: SQLDBType.date

am 01.04.2008 15:24:04 von rbrowning1958

On Apr 1, 1:11=A0pm, Jon Skeet [C# MVP] wrote:
> Jon Skeet [C# MVP] wrote:
>
>
>
> > 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.
>
> --
> Jon Skeet - http://www.pobox.com/~skeet=A0 Blog:http://ww=
w.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

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

Re: SQLDBType.date

am 01.04.2008 15:28:22 von skeet

rbrowning1958 wrote:
> 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.

:)

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk

Re: SQLDBType.date

am 04.04.2008 11:36:13 von rbrowning1958

On Apr 1, 2:28=A0pm, Jon Skeet [C# MVP] wrote:
> rbrowning1958 wrote:
> > 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.
>
> :)
>
> --
> Jon Skeet - http://www.pobox.com/~skeet=A0 Blog:http://ww=
w.msmvps.com/jon.skeet
> World class .NET training in the UK:http://iterativetraining.co.uk

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

Re: SQLDBType.date

am 04.04.2008 12:00:49 von skeet

rbrowning1958 wrote:
> 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.

--
Jon Skeet -
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
World class .NET training in the UK: http://iterativetraining.co.uk