how to add connection string for a windows form applicaton in asp.net
- by manoj chalode
i am working on windows form application and i want to add connection string of a database in. Right now, though i can access database i don't know the proper reasoning behind it.
I have created a database and added it in a "Database" folder. The code for it is given below. i also want to know how can I make a connection string which can work on different PCs without changing it (I'm talking about relative path given in the "AttachDbFilename" attribute in the connection string).
Reply...
Conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename="+ Application.StartupPath + "\\Database\\Database.mdf;Integrated Security=True;User Instance=True");