c#中连接数据库的两种方法

方法一:

string myConn = System.Configuration.ConfigurationManager.ConnectionStrings

["sqlConnectionString"].ConnectionString;
方法二:

string connString = System.Web.Configuration.WebConfigurationManager.ConnectionStrings

["sqlConnectionString"].ToString();

posted @ 2010-04-08 00:16  suzihuy  阅读(195)  评论(0编辑  收藏  举报