我添加了一个c#类库,在里面写了个类,是用来创建数据库连接字符串的,然后编译这个类,也在添加引用里添加引用了这个类库,也在bin下生成dll,为什么我把类库里的cs文件删了,就没办法用这些类的方法了?我在apsx.cs文件里也using了这个类生成dll,不是说生成dll就不需要cs文件了么?
解决方案 »
- 高手请进,有关抽象工厂模式的疑问
- 一个asp.net mvc站点 可以实现多个Forms 身份验证吗?
- model层两种写法的区别
- c#怎么取当前网络时间(非系统时间)
- 请教:在ASP.NET中母版好用,还是用户自定义控件好用?
- |zyciis| 现在公司要求设计数据库要用UML模式 在网上搜只说.NET 用 VISIO 我记得以前安装VS2003时有,但我现在用VS2008找不到
- 想写一个如下面显示自定义的控件……
- ASP.net下数据库连接问题
- 不容许通过输入页面的路径(绕过身份验证)进入管理页面该怎么办?
- vs2003 aspx页面代码视图滚动条消失了~~~~~~~
- 简体,繁体,英文版本的互换问题!
- 求教:关于FlexCell组件的使用问题
using System;
using System.Data.SqlClient;namespace DB
{
/// <summary>
/// Create_Conn 的摘要说明。
/// </summary>
public class Create_Conn
{
public Create_Conn()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public static SqlConnection CreateConn()
{
SqlConnection Conn_Sql=new SqlConnection("server=.;database=Balance;uid=sa;pwd=;");
return Conn_Sql;
}
}
}//aspx.cs
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using DB;namespace Balance
{
/// <summary>
/// Login 的摘要说明。
/// </summary>
public class Login : System.Web.UI.Page
{
protected System.Web.UI.WebControls.ImageButton ImageButton1;
protected System.Web.UI.WebControls.TextBox Validate_Code;
protected System.Web.UI.WebControls.TextBox UserName;
protected System.Web.UI.WebControls.TextBox PassWord;
protected System.Web.UI.WebControls.ImageButton ImageButton2;
protected System.Web.UI.WebControls.ImageButton Btn_Login;
protected System.Web.UI.WebControls.Image Btn_Cancel;
protected DragonWebControls.ValidateCode ValidateCode;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
SqlConnection Conn=Create_Conn.CreateConn();
Conn.Open();
Response.Write("数据库状态"+Conn.State.ToString());
} #region Web 窗体设计器生成的代码
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
((System.ComponentModel.ISupportInitialize)(this.ValidateCode)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.ValidateCode)).EndInit();
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
}
}