473,414 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

DataType Enum?

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

Cheers
Johnny J.
Sep 14 '07 #1
3 1734
Johnny,

Try the SqlDbType enumeration in the System.Data namespace.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Johnny J." <jo**@altcom.sewrote in message
news:e7*************@TK2MSFTNGP06.phx.gbl...
Does anybody know if VS 2005 contains an enum of the datatypes available
in an SQL Server database?

Cheers
Johnny J.

Sep 14 '07 #2
Thanks - I'll have a look at it...

Cheers,
Johnny J.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:eB**************@TK2MSFTNGP02.phx.gbl...
Johnny,

Try the SqlDbType enumeration in the System.Data namespace.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Johnny J." <jo**@altcom.sewrote in message
news:e7*************@TK2MSFTNGP06.phx.gbl...
>Does anybody know if VS 2005 contains an enum of the datatypes available
in an SQL Server database?

Cheers
Johnny J.


Sep 14 '07 #3
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 [.NET/C# MVP]" <mv*@spam.guard.caspershouse.comwrote in
message news:eB**************@TK2MSFTNGP02.phx.gbl...
Johnny,

Try the SqlDbType enumeration in the System.Data namespace.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Johnny J." <jo**@altcom.sewrote in message
news:e7*************@TK2MSFTNGP06.phx.gbl...
>Does anybody know if VS 2005 contains an enum of the datatypes available
in an SQL Server database?

Cheers
Johnny J.


Sep 17 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Andreas Huber | last post by:
Hi there Spending half an hour searching through the archive I haven't found a rationale for the following behavior. using System; // note the missing Flags attribute enum Color {
31
by: Michael C | last post by:
If a class inherits from another class, say Form inherits from control, then I can assign the Form to a variable of type Control without needing an explicit conversion, eg Form1 f = new Form1();...
13
by: Don | last post by:
How do I get an Enum's type using only the Enum name? e.g. Dim enumType as System.Type Dim enumName as String = "MyEnum" enumType = ???(enumName)
1
by: Randy | last post by:
Hi, I downloaded and tried the ENUM++ code from CUJ http://www.cuj.com/documents/s=8470/cujboost0306besser/ but can't even get it to compile (see following). I have also downloaded and...
2
by: Randy | last post by:
Hi, I downloaded and tried the ENUM++ code from CUJ http://www.cuj.com/documents/s=8470/cujboost0306besser/ but can't even get it to compile (see following). I have also downloaded and...
4
by: Brent Ritchie | last post by:
Hello all, I have been wondering is it possible to get the datatype of an enumeration without using reflection. To clearify if I do: enum Genders { Male, Female }
4
by: UJ | last post by:
I have a datatype that I want to use as a type for a column (It's an enumeration.) but I can't get the syntax right. Can you even do it? Or do I need to do it as a string and convert it back and...
1
by: Bryan | last post by:
I have a class called "Prop". I want that class to have a property called "DataType" where the user can select and store a datatype. How can I store a DataType value in a class property. how...
34
by: Steven Nagy | last post by:
So I was needing some extra power from my enums and implemented the typesafe enum pattern. And it got me to thinking... why should I EVER use standard enums? There's now a nice little code...
3
by: Johnny J. | last post by:
Does anybody know if VS 2005 contains an enum of the datatypes available in an SQL Server database? Cheers Johnny J.
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.