How can i iterate through all System.Data.SqlDbType s?

100 Views Asked by At

As my questeion above i would like to iterate through ALL System.Data.SqlDbTypes. How is this possible?

I'm thinking about something like this:

foreach (var type in System.Data.SqlDbType(s))
{
   ..code         
}

I know System.Data.SqlDbType is no List or IEnumerable :)

1

There are 1 best solutions below

3
On BEST ANSWER

You may try this:

foreach (SqlDbType type in Enum.GetValues(typeof(SqlDbType)))
{
   ..code
}