about connection string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tushar Dutt
    New Member
    • Mar 2010
    • 1

    about connection string

    I am developing a software using vb.net and SQL server as database .
    it takes the name of my system in connection string and when i try to load my software in other computers it search the same name.how can i define a connection string that takes the name of system on which software is loaded?
  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    I'll asume you also moving the SQL base to the other computer, and you're using windows autentication, you can use ENVIRON("USERNA ME") to retrieve the user name, something like this will do:

    Conexion1.Conne ctionString = "Server=" & Environ("userna me") & "\MyServer;Data base=MyDB;Trust ed_Connection=T rue;"

    Comment

    Working...