首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

aspxdevexpress这么绑定数据库,哪错了

2013-02-17 
aspxdevexpress这样绑定数据库,哪错了?这样绑定aspxgridview哪错了?用gridview可以SqlConnection cn new

aspxdevexpress这样绑定数据库,哪错了?
这样绑定aspxgridview哪错了?用gridview可以

SqlConnection cn = new SqlConnection(ConfigurationManager.ConnectionStrings["pubsConnectionString"].ConnectionString);
        string selectsql = "select * from t_user";
        SqlCommand cmd = new SqlCommand(selectsql, cn);
        SqlDataAdapter da = new SqlDataAdapter(cmd);
        DataSet ds = new DataSet();
        da.Fill(ds, "t_user");
        this.ASPxGridView1.DataSource = ds.Tables["t_user"].DefaultView;
        this.ASPxGridView1.DataBind();

[解决办法]

        this.ASPxGridView1.DataSource = ds.Tables["t_user"];
        this.ASPxGridView1.DataBind();

[解决办法]
怀疑用gridview可以应该是gridview有CreateAutoGeneratedColumn可以自动生成列,而aspxdevexpress没有自动生成列
[解决办法]
连接是否要打开? cn.open()

热点排行