DataType Enum?

  • Thread starter Thread starter Johnny J.
  • Start date Start date
J

Johnny J.

Does anybody know if VS 2005 contains an enum of the datatypes available in
an SQL Server database?

Cheers
Johnny J.
 
Johnny,

Try the SqlDbType enumeration in the System.Data namespace.
 
Thanks - I'll have a look at it...

Cheers,
Johnny J.



Nicholas Paldino said:
Johnny,

Try the SqlDbType enumeration in the System.Data namespace.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Johnny J. said:
Does anybody know if VS 2005 contains an enum of the datatypes available
in an SQL Server database?

Cheers
Johnny J.
 
Is it possible to use this enum to assess the type of a DataGridView column?
I tried

foreach (DataGridViewColumn tempColumn in m_DataGridView.Columns)

{

switch (tempColumn.ValueType)

{

case SqlDbType.Int:

//This is an integer

break;

}

}



But that doesn't work. I get a compiler error saying: Cannot convert type
'System.Type' to 'System.Data.SqlDbType'.

And I can't cast tempColumn.ValueType to a System.Data.SqlDbType....

/Johnny J.









Nicholas Paldino said:
Johnny,

Try the SqlDbType enumeration in the System.Data namespace.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Johnny J. said:
Does anybody know if VS 2005 contains an enum of the datatypes available
in an SQL Server database?

Cheers
Johnny J.
 
Back
Top