 Dim constring As String = Application.StartupPath.ToString() + "\mydatabaseName.mdf" Public c As String = "Data Source=.\SQLEXPRESS;AttachDbFilename=" + constring + ";Integrated      Security=True;User Instance=True"  