private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
SqlConnection conn= new SqlConnection();
conn.ConnectionString = "user id=sa;password=43572950;initial catalog=GuestBook;Data Source=ZHAN;connect Timeout=20";
conn.Open();
string sql;
sql="select * from GuestBook where GID="+Request.QueryString["GID"]+"";
SqlDataAdapter comm=new SqlDataAdapter(sql,conn);
DataSet ds=new DataSet();
comm.Fill(ds,"GuestBook");
Title.Text=ds.Tables["GuestBook"].Rows[0][4].ToString();
Content.Text=ds.Tables[0].Rows[0][5].ToString();
}
{
// 在此处放置用户代码以初始化页面
SqlConnection conn= new SqlConnection();
conn.ConnectionString = "user id=sa;password=43572950;initial catalog=GuestBook;Data Source=ZHAN;connect Timeout=20";
conn.Open();
string sql;
sql="select * from GuestBook where GID="+Request.QueryString["GID"]+"";
SqlDataAdapter comm=new SqlDataAdapter(sql,conn);
DataSet ds=new DataSet();
comm.Fill(ds,"GuestBook");
Title.Text=ds.Tables["GuestBook"].Rows[0][4].ToString();
Content.Text=ds.Tables[0].Rows[0][5].ToString();
}