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

asp.net中怎么用repeater控件显示数据库表信息??下面的代码不显示数据呢?

if (!IsPostBack)
            {
                SqlConnection con = new SqlConnection("server=(local);uid=sa;pwd=;database=LibraryMS");
                con.Open();
                SqlDataAdapter ada = new SqlDataAdapter("select * from view_BookBRInfo", con);
                DataSet ds = new DataSet();
                ada.Fill(ds);
                this.Repeater1.DataSource = ds.Tables[0].DefaultView;
                this.Repeater1.DataBind();
            }
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,