标签:
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.SpecialSettingAttribute(global::System.Configuration.SpecialSetting.ConnectionString)]
[global::System.Configuration.DefaultSettingValueAttribute("Data Source=127.0.0.1;Initial Catalog=MatchDB;Persist Security Info=True;Us" +
"er ID=sa;Password=sa")]
public string MatchDBConnectionString {
get {
//下面这几句
var connstr = "MatchDBConnectionString";//web.config里的conn名
return System.Configuration.ConfigurationManager.ConnectionStrings[connstr].ConnectionString ??
((string)(this["MatchDBConnectionString"]));
}
}
让LinqToSQL使用Web.Config中的链接字符串(修改Settings.Designer.cs)
标签:
原文地址:http://www.cnblogs.com/hsw-2013/p/4255276.html