文件名称:ASP.NET动态生成静态页面技术
文件大小:3KB
文件格式:TXT
更新时间:2013-10-06 09:15:43
asp.net,生成静态页,动态,技术,生成静态类
public class HtmlWriter : System.Web.UI.Page { PRivate System.Data.SqlClient.SqlDataAdapter myAdapter; private System.Data.SqlClient.SqlConnection myConn; private System.Data.DataTable myDt; private string strConn = ConfigurationSettings.AppSettings["cns"]; private void Page_Load(object sender, System.EventArgs e) { try { string Sqlstr = "Select Cmp_description from Company where Cmp_number = '123567'"; string cription=""; myDt = new DataTable(); myConn = new SqlConnection(strConn); myConn.Open(); myAdapter = new SqlDataAdapter(Sqlstr,myConn); myAdapter.Fill(myDt); if(myDt.Rows.Count>0) { cription = myDt.Rows[0]["Cmp_description"].ToString(); } string title = "这是动态生成的静态页面";