none
GridView出现重复的列,到底是为什么呢? RRS feed

  • 问题

  • 后台是这样 

    conn = new OracleConnection(sqlconn);
            OracleDataAdapter adapter = new OracleDataAdapter("select * from client_informa", conn);
            DataSet data = new DataSet();
            conn.Open();
            adapter.Fill(data, "client_informa");
            GridView1.DataSource = data;
            GridView1.DataKeyNames = new string[] { "ID" };
            GridView1.DataBind();
            conn.Close();

    前台是这样

    <asp:BoundField DataField="ID" HeaderText="用户 ID" ReadOnly=false />
                <asp:BoundField DataField="CNAME" HeaderText="名字" />
                <asp:BoundField DataField="CSEX" HeaderText="性别" />
                <asp:BoundField DataField="CADDRESS" HeaderText="家庭住址" />
                <asp:CommandField HeaderText="选择" ShowSelectButton=true />
                <asp:CommandField HeaderText="编辑" ShowEditButton=true />
                <asp:CommandField HeaderText="删除" ShowDeleteButton=true />

    2012年11月12日 4:02

答案

全部回复