Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all

I have a program which does the backup and restore of sql database.now for each system i am defining the server name and connection string manually like below

VB
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      
       server("KITT7-PC")
   End Sub
   Sub server(ByVal str As String)
       Try

           con = New SqlConnection("Data Source= KITT7-PC;Database=Master;integrated security=True;")
           con.Open()


now i want is if i am putting the same application in other system then it should automatically take the server name and connection string so that manually we don't have to change that.

Thank you
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900