I have the following map that I use to convert betwen SQL Server types, SQLData types, and .NET types:
///
/// The map of types. THis map
char
is not the correct .NET data type for a SQL Server char
. It must be converted to either char[]
or string
, since a SQL char
can hold more than one character.
The Microsoft reference here agrees with me. The other ones look correct.
According to MSDN you have all three (char, varchar, text) correct.
See: http://msdn.microsoft.com/en-us/library/system.data.sqltypes.aspx
Also to add one more for SQL 2008 anyway Table converts to DataTable
I give an example of how to use this type here SQL Server stored procedure convert varchar to int
[Edit]
char is not the correct .NET data type for a SQL Server char.
It must be converted to either char[] or string,
since a SQL char can hold more than one character.
Credit to @RedFilter for that one