Public Sub main() constr = "Data Source=.\SQLEXPRESS;AttachDbFilename=C:"database file".mdf;" & _ "Integrated Security=True;Connect Timeout=30;User Instance=True" Con = New SqlConnection(constr) Try Con.Open() 'MsgBox("Server Connection is Open ! ") 'frmMain.Connection.Text = "Connecting To serv``er" Con.Close() Catch ex As Exception MsgBox("Sorry Can not open connection ! ", vbCritical, "Database") End Try End Sub
My project will be installed on several computers. The database in integrated in my project since i used Service-Based Database. Meaning when I transfer the project to different computers the database always comes with it.
I'm thinking that when I will make an executable project, the database will be included. How will I change the datasource above during installation of my project just to ensure that there will be a single server for my database?