Converts the specified .NET type to SQL Server type.
Namespace: Nemiro.Data.SqlAssembly: Nemiro.Data (in Nemiro.Data.dll) Version: 2.11.4.126 (2.11.4.126)
public static SqlDbType ConvertToSqlDbType(
Type t,
Version version = null
)
public static SqlDbType ConvertToSqlDbType(
Type t,
Version version = null
)
Public Shared Function ConvertToSqlDbType (
t As Type,
Optional version As Version = Nothing
) As SqlDbType
Public Shared Function ConvertToSqlDbType (
t As Type,
Optional version As Version = Nothing
) As SqlDbType
Parameters
- t
- Type: System Type
.NET type.
- version (Optional)
- Type: System Version
Version SQL Server.
Return Value
Type:
SqlDbTypeSqlDbType result = SqlType.ConvertToSqlDbType(typeof(long));
Console.WriteLine("SQL Server type: {0}", result.ToString());
SqlDbType result = SqlType.ConvertToSqlDbType(typeof(long));
Console.WriteLine("SQL Server type: {0}", result.ToString());
Dim result As SqlDbType = SqlType.ConvertToSqlDbType(GetType(Long))
Console.WriteLine("SQL Server type: {0}", result.ToString())
Dim result As SqlDbType = SqlType.ConvertToSqlDbType(GetType(Long))
Console.WriteLine("SQL Server type: {0}", result.ToString())