change your Connection class to get connection as below
public class Connection
{
public static SqlConnection GetConnection( string val)
{ string conn ="";
if (val == "1")
{
conn = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
}
else if (val == "2")
{
conn = ConfigurationManager.ConnectionStrings["connectionString1"].ConnectionString;
}
return new SqlConnection(conn);
}
}
then you can do as below in other classes
public string isLogin()
{
SqlConnection clsConn= Connection.GetConnection("2");
SqlCommand cmd = new SqlCommand("login", clsConn);
}