1、配置文件
2、实例化时传参,Application.StartupPath返回当前程序运行路径。
DBHelper db = new DBHelper(Application.StartupPath);
3、构造方法
public DBHelper(string dbPath)
{
this.connString = this.connString.Replace("|path|", dbPath);
}