if(!Page.IsPostBack)
{
DataSet ds = new DataSetDA().selectData("select w.userlog,w.WNID,w.WNtitle,w.WNtext,w.WNtime,(select u.username from usertab u where u.userlogo=w.userlog) as username from businesszhanshi w where w.WNID='"+Request.QueryString["id"].ToString()+"' ");
if(ds.Tables[0].Rows.Count!=0)
{
TextBox3.Text = ds.Tables[0].Rows[0]["WNtitle"].ToString();
TextBox2.Text = ds.Tables[0].Rows[0]["username"].ToString();
TextBox1.Text = DateTime.Parse(ds.Tables[0].Rows[0]["WNtitle"].ToString()).ToShortDateString();
FCKtxtU.Value = ds.Tables[0].Rows[0]["WNtext"].ToString();
}
}
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
//DataSetDA()类
public DataSet selectData(string sql)
{
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(sql, new SqlConnection(new Common().GetConnectionString()));
da.Fill(ds);
return ds;
}
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
//Common()类
private string con = System.Configuration.ConfigurationSettings.AppSettings["con"];
public Common()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
public string GetConnectionString()
{
return con;
}
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
//webconfig配置文件
<appSettings>
<add key="con" value="server=.;database=HY;uid=sa;pwd=mdsoft;"/>
// <add key="FCKeditor:BasePath" value="~/fckeditor/"/>
//<add key="FCKeditor:UserFilesPath" value="../../../../../FCKUploadImage/"/>
</appSettings>
。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
完成类对类的层级取调,顺序由下至上。

被折叠的 条评论
为什么被折叠?



