Take the 2-minute tour ×

I connected my database as a (sql server database file) to mt c# .net application. the connection string was given as a relative path. the client computer asks for sql express server, what should i do? which application should i install in the client pc?

share|improve this question
Show us your local relative path. –  LaGrandMere Dec 15 '10 at 17:04
"Data Source=.\\SQLEXPRESS;AttachDbFilename=\""+Application.StartupPath+"\\defects.mdf\"‌​;Integrated Security=True;Connect Timeout=30;User Instance=True"); –  harshani Dec 15 '10 at 17:17
@harshani: please don't post stuff like connection strings into comments - this is very hard to read.... instead: update your original question by editing it and nicely format your connection string! –  marc_s Dec 15 '10 at 17:21
Why didn't you attach the database in the normal way instead of using attchdbfilename? –  Jani Dec 15 '10 at 17:21
sorry guys.....when you attach the database file in the normal way the connectionstring is developed automatically, so the the db path is given locally, when the software is installed it gives another error as "cannot find c:/user/harshani.......db" ,when i gave the above connection string that error didnt come up but asks for SQLEXPRESS on the machine. hope u can understand –  harshani Dec 15 '10 at 17:34
show 1 more comment

1 Answer

You need to supply the correct connection string, with the database server name.

If the application is supposed to connect to a local database (on the same machine as the application), you need to install SQL Express and setup the database on the client machine.

share|improve this answer
add comment

Your Answer


