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就能选取了

你可能感兴趣的:(asp.net)