J Johnny J. Sep 14, 2007 #1 Does anybody know if VS 2005 contains an enum of the datatypes available in an SQL Server database? Cheers Johnny J.
Does anybody know if VS 2005 contains an enum of the datatypes available in an SQL Server database? Cheers Johnny J.
N Nicholas Paldino [.NET/C# MVP] Sep 14, 2007 #2 Johnny, Try the SqlDbType enumeration in the System.Data namespace.
J Johnny J. Sep 14, 2007 #3 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. Click to expand... Click to expand...
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. Click to expand... Click to expand...
J Johnny J. Sep 17, 2007 #4 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. Click to expand... Click to expand...
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. Click to expand... Click to expand...