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()