当前位置:编程学习 > C#/ASP.NET >>

帮我看看ASP.net 代码?每一句的代码,说一下是什么定义?

代码如下 

SqlConnection conn = new SqlConnection("Data Source=.;Initial Catalog=BBS;Integrated Security=true");
        SqlCommand Cmd = new SqlCommand("select * from [Info] where ID=" + Request.QueryString["id"], conn);
        conn.Open();
        SqlDataReader obj = Cmd.ExecuteReader();
        while (obj.Read())
        {
            LblName.Text = obj.GetValue(2).ToString();
            LblDate.Text = obj.GetValue(4).ToString();
            TxtSubject.Text = obj.GetValue(1).ToString();
            TxtContent.Text = obj.GetValue(3).ToString();
        }
        obj.Close();
        conn.Close();
        string sql = "Select * From [info] where 回复编号='" + Request.QueryString["id"] + "'";
        SqlDataAdapter adapter = new SqlDataAdapter(sql, conn);
        DataSet ds = new DataSet();
        adapter.Fill(ds, "Reply");
        DataList1.DataSource = ds.Tables[0].DefaultView;
        DataList1.DataBind();

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,