在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<connectionStrings>
<add name = "mdbconn" [String, Required, Collection Key] connectionString = "" [String, Required] providerName = "System.Data.SqlClient" [String] /> </connectionStrings> 读取: string strConnection = ConfigurationManager.ConnectionStrings["mdbconn"].ToString(); 第二种方法设置: <appSettings> <add key="strcon" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Backup\我的文档\Visual Studio 2005\WebSites\4ec\App_Data\company.mdb"/> </appSettings> <connectionStrings/> 读取: OleDbConnection con = new OleDbConnection(ConfigurationSettings.AppSettings["strcon"]); |
请发表评论