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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 .\SQLEXPRESS VS .\\SQLEXPRESS

Author  Topic 

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2010-09-27 : 22:24:10
Hi, I am confused between them.
.\SQLEXPRESS

.\\SQLEXPRESS

    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)
Go to Top of Page
   

- Advertisement -