写一个类,专门来处理数据操作方面的,这个在petshop内有,你可以看看他的SQLHelper这个类
大概这样:public abstract class SqlHelper {        //Database connection strings
    public static readonly string ConnectionStringLocalTransaction =ConfigurationManager.ConnectionStrings["SQLConnString1"].ConnectionString;
...
}