ASP.NET 的Select 怎么用啊


protected void Page_Load(object sender, EventArgs e)
    {
        DataTable Dt = new DataTable();
        DataRow Dr;
        Dt.Columns.Add("Name", typeof(String));
        Dt.Columns.Add("No", typeof(String));
        Dr = Dt.NewRow();
        Dr["No"]=1;
        //int i = 1;
        Dr["Name"]="zs";
        Dt.Rows.Add(Dr);
        Session["Dt"] = Dt;
        DataRow[] Rows;
        Rows = ((DataTable)Session["Dt"]).Select("Name=zs");
        //string str1 = Rows[0]["Name"].ToString();
       // i = str1.CompareTo("zs");
        TextBox1.Text = Rows[0]["Name"].ToString();

    }
当我把Name=zs改为No=1就能选取了

posted on 2007-03-17 14:48  漫步人生  阅读(2528)  评论(6编辑  收藏  举报