Could you please tutor me on how to make this connection? (using visual studio 2008)

@"Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\DBRestaurant.mdf;Integrated Security=True;Persist Security Info=False;User ID=annamarie;TrustServerCertificate=False;User Instance=True"

Recommended Answers

All 3 Replies

Here you will find how to create the right connection string.

cannot open user default database. Login failed. Login failed for user '....'

how can i fix that?

You can't use Integrated Security=True and user id and password in same connection string. Integrated Security=True demand to use the windows authentication credential for loging. if you use sql authentication mention user id and password in the connection string.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.