0

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?

6
  • 1
    Show us your local relative path. Commented Dec 15, 2010 at 17:04
  • "Data Source=.\\SQLEXPRESS;AttachDbFilename=\""+Application.StartupPath+"\\defects.mdf\";Integrated Security=True;Connect Timeout=30;User Instance=True"); Commented Dec 15, 2010 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! Commented Dec 15, 2010 at 17:21
  • Why didn't you attach the database in the normal way instead of using attchdbfilename? Commented Dec 15, 2010 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 Commented Dec 15, 2010 at 17:34

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.