C To Vb.net

Format

  • 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.

-->Code

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.

C To Vb.netVb.net
SQL Server Database Engine type.NET Framework typeSqlDbType enumerationSqlDataReader SqlTypes typed accessorDbType enumerationSqlDataReader DbType typed accessor
bigintInt64BigIntGetSqlInt64Int64GetInt64
binaryByte[]VarBinaryGetSqlBinaryBinaryGetBytes
bitBooleanBitGetSqlBooleanBooleanGetBoolean
charString
Char[]
CharGetSqlStringAnsiStringFixedLength,
String
GetString
GetChars
date 1
(SQL Server 2008 and later)
DateTimeDate1GetSqlDateTimeDate1GetDateTime
datetimeDateTimeDateTimeGetSqlDateTimeDateTimeGetDateTime
datetime2
(SQL Server 2008 and later)
DateTimeDateTime2NoneDateTime2GetDateTime
datetimeoffset
(SQL Server 2008 and later)
DateTimeOffsetDateTimeOffsetnoneDateTimeOffsetGetDateTimeOffset
decimalDecimalDecimalGetSqlDecimalDecimalGetDecimal
FILESTREAM attribute (varbinary(max))Byte[]VarBinaryGetSqlBytesBinaryGetBytes
floatDoubleFloatGetSqlDoubleDoubleGetDouble
imageByte[]BinaryGetSqlBinaryBinaryGetBytes
intInt32IntGetSqlInt32Int32GetInt32
moneyDecimalMoneyGetSqlMoneyDecimalGetDecimal
ncharString
Char[]
NCharGetSqlStringStringFixedLengthGetString
GetChars
ntextString
Char[]
NTextGetSqlStringStringGetString
GetChars
numericDecimalDecimalGetSqlDecimalDecimalGetDecimal
nvarcharString
Char[]
NVarCharGetSqlStringStringGetString
GetChars
realSingleRealGetSqlSingleSingleGetFloat
rowversionByte[]TimestampGetSqlBinaryBinaryGetBytes
smalldatetimeDateTimeDateTimeGetSqlDateTimeDateTimeGetDateTime
smallintInt16SmallIntGetSqlInt16Int16GetInt16
smallmoneyDecimalSmallMoneyGetSqlMoneyDecimalGetDecimal
sql_variantObject 2VariantGetSqlValue2ObjectGetValue2
textString
Char[]
TextGetSqlStringStringGetString
GetChars
time
(SQL Server 2008 and later)
TimeSpanTimenoneTimeGetDateTime
timestampByte[]TimestampGetSqlBinaryBinaryGetBytes
tinyintByteTinyIntGetSqlByteByteGetByte
uniqueidentifierGuidUniqueIdentifierGetSqlGuidGuidGetGuid
varbinaryByte[]VarBinaryGetSqlBinaryBinaryGetBytes
varcharString
Char[]
VarCharGetSqlStringAnsiString, StringGetString
GetChars
xmlXmlXmlGetSqlXmlXmlnone

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.

Code

SQL Server documentation

For more information about SQL Server data types, see Data types (Transact-SQL).

C# To Vb.net File

See also