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.
 

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

Similar Threads

Enums in databases 7
about enum 3
Enum TypeConverter 3
enum type 3
Q: property problem (enum) 3
PInvoke Question - C to C# 5
Merge Info From Two Enums 1
Enums in a database 10

Back
Top