Connection string in vb.net vs C sharp

I have the following connection string in c#. what will be its equivalent in vb.net
@"SERVER=GAATLENDCTU123W\SQLEXPRESS; Initial Catalog=Test;Integrated Security=SSPI ";
AbebeDemekeAsked:
Who is Participating?
 
Raja Jegan RConnect With a Mentor SQL Server DBA & ArchitectCommented:
You can use:

Provider=SQLNCLI;Server=GAATLENDCTU123W\SQLEXPRESS;Database=Test;Trusted_Connection=yes;

Complete set of options below:

http://www.connectionstrings.com/sql-server-2005
0
 
YZlatConnect With a Mentor Commented:
same thing in VB.NET except you won't need @ escape character in front of the string:

dim strConn="SERVER=GAATLENDCTU123W\SQLEXPRESS; Initial Catalog=Test;Integrated Security=SSPI " 
0
 
YZlatCommented:
also I'd suggest changing your connection string to the following:

"Data Source=GAATLENDCTU123W\SQLEXPRESS;Initial Catalog=Test;Integrated Security=SSPI;"

dim strConn as string="Data Source=GAATLENDCTU123W\SQLEXPRESS;Initial Catalog=Test;Integrated Security=SSPI;"
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.