Create a constructor that takes the connection string as a parameter.
public class classfile
{
private string _connectionString;
public classfile(string connectionString)
{
_connectionString = connectionString;
}
}
Now everywhere in your class you can use the '_connectionString' member. (if the methods aren't static)
And everywhere you instantiate your classfile class you'll have to pass the connectionstring.