try like this
In app.config file create one connection string
="1.0"
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0" />
</startup>
<connectionStrings>
<add name="DBSqlServerConnectionstring" connectionString="Password=Your Password;Connection Timeout=0;Persist Security Info=False;User ID=userid;Initial Catalog=databasename;Data Source=servername;" />
</connectionStrings>
</configuration>
and access this in your form using
public static string DBSqlServerConstringSQLAuth
{
get
{
return ConfigurationManager.ConnectionStrings["DBSqlServerConnectionstring"].ToString();
}
}