数据视图DataView

DataView dv = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);//用SqlDataSource1的Select方法,通过DataSourceSelectArguments查询参数执行数据筛选.不过你这里参数为空.
        foreach (DataRow dr in dv.Table.Rows)
        {//逐行输出数据视图(DataView)对象里所有数据
            Response.Write(dr["userName"]);
            Response.Write(dr["password"]);
            Response.Write(dr["sex"]);
            Response.Write(dr["age"]);
            Response.Write("<br>");
           
        }

你可能感兴趣的:(view)