Skip to main content
Skip table of contents

Differences between C# and VB.Net Syntax

Workflows use VB.Net syntax for expressions. 

WorkflowEditor 2.x will support C# syntax for expressions.

VB.Net

C#

Case-sensitive

no

yes

Null reference

VB
Nothing
C#
null

Equals operator

=

==

Equals Not operator

<>

!=

Comparison to null

VB
a is Nothing
C#
a == null

Character literal

"a"C

'a'

String escaping

Backslash: "\"

Quotes: double quote

Backslash: "\\" or @"\"

Quotes: "\"" or @"""" (double quote)

Access indexed elements

Round brackets ( )

Square brackets [ ]

Generic types

VB
New List(Of String)
New Dictionary(Of String, Object)
C#
new List<string>()
new Dictionary<string, object>()

Object initializers

VB
New Entry With { .Title = "Test" }
VB
New List(Of String) From { "abc", "def" }

For a typed array Int32[]

VB
{ 3,1,4 }
C#
new Entry { Title = "Test" }
C#
new List<string> { "abc", "def" }

For a typed array Int32[]

C#
{ 3,1,4 }

Short-circuiting logical operators

VB
a AndAlso b
a OrElse b

And/Or are always evaluating ALL parts of it!

C#
a && b
a || b

Non-short circuiting logical operators

VB
a And b
a Or b

Example:

VB
Not (entry Is Nothing) And entry.Title = "Test"

Will throw exception when entry is Nothing!

n/a

Anonymous function

VB
Function(a,b) a+b
C#
(a,b) => a + b

LINQ

VB
a.Select(Function(n) n+1).ToArray()
C#
a.Select(n => n+1).ToArray()

Data type names

Integer

int

Also see https://en.wikipedia.org/wiki/Comparison_of_C_Sharp_and_Visual_Basic_.NET

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.