谁能帮我解答? 请问在asp.net中,resource.GetString(),config集合,settings集合怎么使用 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <appSettings> <add key="ConnSql" value="server=localhost;database=study;uid=sa;pwd=sa"></add> </appSettings>-----------------------下面是使用. /// <summary> /// 打开数据库 /// </summary> public void Open() { if (conn==null) { //System.Web.HttpContext.Current.Response.Write("<BR>CONN IS NULL ,CREATE A NEW CONN2"); conn= new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnSql"]); } try { if(conn.State==System.Data.ConnectionState.Closed) { //System.Web.HttpContext.Current.Response.Write("<BR>CONN IS CLOSED2"); conn.Open(); } } catch(SqlException Ex) { //System.Web.HttpContext.Current.Response.Write("<br>err:"+Ex.Message.ToString()); System.Web.HttpContext.Current.Response.End(); // page.Response.Write ("err:"+Ex.Message.ToString()); // page.Response.End(); } finally { //System.Web.HttpContext.Current.Response.End(); } } && 和 || 是不是一样? asp.net程序安装之后浏览在登录界面输入用户名和密码的地方不见了什么原因 jsp如何访问模板列? ASP初学者问题 |M| 在用.NET的asp:TreeView 不太合适我的作用,这时要用什么方法来解决 100分的问题! 地图定位~~~ 求助,大家看看,那里的代码如何写啊. IHttpHandler 接口 哪里有wap wml文档下载 怎样获得当前日期???并赋值给 Calendar 页面刷新问题 用相同的连接字符串建立的连接能否并行操作?
<add key="ConnSql" value="server=localhost;database=study;uid=sa;pwd=sa"></add>
</appSettings>
-----------------------
下面是使用.
/// <summary>
/// 打开数据库
/// </summary>
public void Open()
{
if (conn==null)
{
//System.Web.HttpContext.Current.Response.Write("<BR>CONN IS NULL ,CREATE A NEW CONN2");
conn= new SqlConnection(System.Configuration.ConfigurationSettings.AppSettings["ConnSql"]);
}
try
{
if(conn.State==System.Data.ConnectionState.Closed)
{
//System.Web.HttpContext.Current.Response.Write("<BR>CONN IS CLOSED2");
conn.Open();
}
}
catch(SqlException Ex)
{
//System.Web.HttpContext.Current.Response.Write("<br>err:"+Ex.Message.ToString());
System.Web.HttpContext.Current.Response.End();
// page.Response.Write ("err:"+Ex.Message.ToString());
// page.Response.End();
}
finally
{
//System.Web.HttpContext.Current.Response.End();
}
}