我是在配置文件config.web里写的
<appSettings>
<add dey="ConnectionString" value="server=localhost\NetSDK;database=denglu;integrated security=SSPI;">
</appSettings>
然后我又新建了一个Cuser类在构造函数里是这样写的
SqlConnection myConnection=new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand myCommand=new SqlCommand("select * from user",myCommection);
myConnection.Open();
myConnection.Close();
我在Menu.ascx.cs里写Cuser u=new Cuser;
都在同一个命名空间里
为什么在myConnection.Open();里有错
<appSettings>
<add dey="ConnectionString" value="server=localhost\NetSDK;database=denglu;integrated security=SSPI;">
</appSettings>
然后我又新建了一个Cuser类在构造函数里是这样写的
SqlConnection myConnection=new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"]);
SqlCommand myCommand=new SqlCommand("select * from user",myCommection);
myConnection.Open();
myConnection.Close();
我在Menu.ascx.cs里写Cuser u=new Cuser;
都在同一个命名空间里
为什么在myConnection.Open();里有错
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货