DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 6 Aug 2007 21:54:54 -0400,    posted on: microsoft.public.dotnet.framework.adonet        back       

Thread Index
  1    Jen
          2    Miha Markic miha at rthand com
          3    Jen
          4    Miha Markic miha at rthand com


Detecting database column data type of smalldatetime vs. datetime?   
Is there a way for C# ADO.NET code to determine whether a SQL Server column 
data type is smalldatetime vs. datetime?  It looks like DataColumn.DataType 
makes no distinction, both return DateTime.
Date:Mon, 6 Aug 2007 21:54:54 -0400   Author:  

Re: Detecting database column data type of smalldatetime vs. datetime?   
You should use SqlConnection.GetSchema method to retrieve these kind of 
information.

-- 
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Jen"  wrote in message 
news:Op1I2XJ2HHA.6072@TK2MSFTNGP03.phx.gbl...

> Is there a way for C# ADO.NET code to determine whether a SQL Server 
> column data type is smalldatetime vs. datetime?  It looks like 
> DataColumn.DataType makes no distinction, both return DateTime.
> 
Date:Tue, 7 Aug 2007 09:49:54 +0200   Author:  

Re: Detecting database column data type of smalldatetime vs. datetime?   
I'm using OleDb.  Would I use OleDbConnection.GetOldDbSchemaTable?  I'm 
trying that but both smalldatetime and datetime data types seem to return 
135.

Can I not distinguish between the two data types when using OleDb?


"Miha Markic" <miha at rthand com> wrote in message 
news:A8CBEE33-5A89-4DA0-BBA5-02C5E27DCC0B@microsoft.com...

> You should use SqlConnection.GetSchema method to retrieve these kind of 
> information.
>
> -- 
> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
> RightHand .NET consulting & development www.rthand.com
> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>
> "Jen"  wrote in message 
> news:Op1I2XJ2HHA.6072@TK2MSFTNGP03.phx.gbl...
>> Is there a way for C# ADO.NET code to determine whether a SQL Server 
>> column data type is smalldatetime vs. datetime?  It looks like 
>> DataColumn.DataType makes no distinction, both return DateTime.
>>
> 
Date:Tue, 7 Aug 2007 13:22:48 -0400   Author:  

Re: Detecting database column data type of smalldatetime vs. datetime?   
If GetOldDbSchemaTable doesn't suite you then you should use DDL statements 
(i.e. sp_columns stored procedure should do)

-- 
Miha Markic [MVP C#, INETA Country Leader for Slovenia]
RightHand .NET consulting & development www.rthand.com
Blog: http://cs.rthand.com/blogs/blog_with_righthand/

"Jen"  wrote in message 
news:OIQ$WeR2HHA.3640@TK2MSFTNGP06.phx.gbl...

> I'm using OleDb.  Would I use OleDbConnection.GetOldDbSchemaTable?  I'm 
> trying that but both smalldatetime and datetime data types seem to return 
> 135.
>
> Can I not distinguish between the two data types when using OleDb?
>
>
> "Miha Markic" <miha at rthand com> wrote in message 
> news:A8CBEE33-5A89-4DA0-BBA5-02C5E27DCC0B@microsoft.com...
>> You should use SqlConnection.GetSchema method to retrieve these kind of 
>> information.
>>
>> -- 
>> Miha Markic [MVP C#, INETA Country Leader for Slovenia]
>> RightHand .NET consulting & development www.rthand.com
>> Blog: http://cs.rthand.com/blogs/blog_with_righthand/
>>
>> "Jen"  wrote in message 
>> news:Op1I2XJ2HHA.6072@TK2MSFTNGP03.phx.gbl...
>>> Is there a way for C# ADO.NET code to determine whether a SQL Server 
>>> column data type is smalldatetime vs. datetime?  It looks like 
>>> DataColumn.DataType makes no distinction, both return DateTime.
>>>
>>
>
> 
Date:Wed, 8 Aug 2007 09:44:53 +0200   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us