1

I'm beginner in C# and SQL Server. Currently I’m developing a program, the problem is my database file is in DB folder inside project folder. When I try to detach the database file in SQL Server Management Studio it gives an error:

"Data Source=localhost;Initial Catalog=test;Integrated Security=true"

When I the change data source to this

"Data Source=db/test.mdf;Initial Catalog=test;Integrated Security=true"

it gives an error. I don’t know how to insert database file with project to InstallShield to create setup file.

benRollag
  • 1,219
  • 4
  • 16
  • 21
Scorpio
  • 153
  • 1
  • 5
  • 13
  • check this http://stackoverflow.com/questions/173209/how-do-i-connect-to-an-mdf-microsoft-sql-server-database-file-in-a-simple-web – Gonzalo.- Jul 13 '12 at 14:50

2 Answers2

1

You may set up connection using DATA-> new data source dialog. There you will set up all the parameters visually. I think the problem here is that full path is not specified. Also path should be in quotes.

seeker
  • 3,255
  • 7
  • 36
  • 68
0

Also whenever you need help on connection strings for any database http://www.connectionstrings.com/ is a great reference.

antew
  • 949
  • 8
  • 17