Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Private NorthwindConnection As New SqlConnection _ ("Data Source=.\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True")
Private NorthwindConnection As New SqlConnection _ ("Data Source=.\\SQLEXPRESS;Initial Catalog=Northwind;Integrated Security=True")
Thanks.
robvolk
Most Valuable Yak
15732 Posts
Posted - 2010-09-27 : 22:33:43
In .Net, the \ character needs to be doubled in a string, i.e. a connection string (.\\SQLEXPRESS). Otherwise you would use a single \ to reference the SQL Server instance (.\SQLEXPRESS)