- Curl to C# converter. To C# converter. This app converts curl commands to C# code. If you found a bug or have suggestions, please open an issue. Check out some examples below.
- Telerik Code Converter by Progress is free online code converter from C# to VB and from VB to C#. No registration required.
- Code Converter: VB - C#. ICSharp Code Converter. Input code (VB.NET) Convert Code. VB.NET to C# C# to VB.NET. Converted code (C#) Get a more accurate conversion by using our free Code Converter extension for Visual Studio.
A unique architecture is used, built specifically for VB.Net to C# conversions. Most converters use generic syntax-only translators, which aren’t powerful enough to resolve VB’s ambiguities. VBConversions analyzes and understands your code, and digs through the correct versions of referenced assemblies. In-depth analysis is crucial to. Published: 21 Feb 2005 Unedited - Community Contributed: Abstract A quick cheat sheet that highlights some key syntactical differences between C# and VB.NET. While this is not all inclusive this cheat sheet proves to be a handy reference.
-->SQL Server and the .NET Framework are based on different type systems. For example, the .NET Framework Decimal structure has a maximum scale of 28, whereas the SQL Server decimal and numeric data types have a maximum scale of 38. To maintain data integrity when reading and writing data, the SqlDataReader exposes SQL Server–specific typed accessor methods that return objects of System.Data.SqlTypes as well as accessor methods that return .NET Framework types. Both SQL Server types and .NET Framework types are also represented by enumerations in the DbType and SqlDbType classes, which you can use when specifying SqlParameter data types.
The following table shows the inferred .NET Framework type, the DbType and SqlDbType enumerations, and the accessor methods for the SqlDataReader.
SQL Server Database Engine type | .NET Framework type | SqlDbType enumeration | SqlDataReader SqlTypes typed accessor | DbType enumeration | SqlDataReader DbType typed accessor |
---|---|---|---|---|---|
bigint | Int64 | BigInt | GetSqlInt64 | Int64 | GetInt64 |
binary | Byte[] | VarBinary | GetSqlBinary | Binary | GetBytes |
bit | Boolean | Bit | GetSqlBoolean | Boolean | GetBoolean |
char | String Char[] | Char | GetSqlString | AnsiStringFixedLength, String | GetString GetChars |
date 1 (SQL Server 2008 and later) | DateTime | Date1 | GetSqlDateTime | Date1 | GetDateTime |
datetime | DateTime | DateTime | GetSqlDateTime | DateTime | GetDateTime |
datetime2 (SQL Server 2008 and later) | DateTime | DateTime2 | None | DateTime2 | GetDateTime |
datetimeoffset (SQL Server 2008 and later) | DateTimeOffset | DateTimeOffset | none | DateTimeOffset | GetDateTimeOffset |
decimal | Decimal | Decimal | GetSqlDecimal | Decimal | GetDecimal |
FILESTREAM attribute (varbinary(max)) | Byte[] | VarBinary | GetSqlBytes | Binary | GetBytes |
float | Double | Float | GetSqlDouble | Double | GetDouble |
image | Byte[] | Binary | GetSqlBinary | Binary | GetBytes |
int | Int32 | Int | GetSqlInt32 | Int32 | GetInt32 |
money | Decimal | Money | GetSqlMoney | Decimal | GetDecimal |
nchar | String Char[] | NChar | GetSqlString | StringFixedLength | GetString GetChars |
ntext | String Char[] | NText | GetSqlString | String | GetString GetChars |
numeric | Decimal | Decimal | GetSqlDecimal | Decimal | GetDecimal |
nvarchar | String Char[] | NVarChar | GetSqlString | String | GetString GetChars |
real | Single | Real | GetSqlSingle | Single | GetFloat |
rowversion | Byte[] | Timestamp | GetSqlBinary | Binary | GetBytes |
smalldatetime | DateTime | DateTime | GetSqlDateTime | DateTime | GetDateTime |
smallint | Int16 | SmallInt | GetSqlInt16 | Int16 | GetInt16 |
smallmoney | Decimal | SmallMoney | GetSqlMoney | Decimal | GetDecimal |
sql_variant | Object 2 | Variant | GetSqlValue2 | Object | GetValue2 |
text | String Char[] | Text | GetSqlString | String | GetString GetChars |
time (SQL Server 2008 and later) | TimeSpan | Time | none | Time | GetDateTime |
timestamp | Byte[] | Timestamp | GetSqlBinary | Binary | GetBytes |
tinyint | Byte | TinyInt | GetSqlByte | Byte | GetByte |
uniqueidentifier | Guid | UniqueIdentifier | GetSqlGuid | Guid | GetGuid |
varbinary | Byte[] | VarBinary | GetSqlBinary | Binary | GetBytes |
varchar | String Char[] | VarChar | GetSqlString | AnsiString, String | GetString GetChars |
xml | Xml | Xml | GetSqlXml | Xml | none |
1 You cannot set the DbType
property of a SqlParameter
to SqlDbType.Date
.
2 Use a specific typed accessor if you know the underlying type of the sql_variant
.
SQL Server documentation
For more information about SQL Server data types, see Data types (Transact-SQL).