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.