c# - connectionString outside SQL server with App.config file -
i have console application , in app.config need add connectionstring sql server in same network.
if try connectionstring local server passing server='localhost' worked cannot make work outside server.
thanks
here connection file
<?xml version="1.0"?> <configuration> <startup> <supportedruntime version="v4.0" sku=".netframework,version=v4.5"/></startup> <connectionstrings> <add connectionstring="server=localserver;database=database;user=username;pwd=password" name="connection"/> </connectionstrings> </configuration>
example connection outer server:
<connectionstrings> <add name="namespace.settings.outersql" connectionstring="data source=192.168.0.100\sqlexpress;initial catalog=database_name;user id=user;password=password"/> </connectionstrings> you need address remote server , credentials provided (if it's not windows auth, use "integrated security").
Comments
Post a Comment