关于SubSonic的数据绑定问题(已解决)

昨天在学习的过程中,偶然间改了下数据表,然后就出现了一个问题:

用dataset方式绑定的数据在ext:grid中能正确显示,然而直接查询的则是只能显示最初没有改动过的数据。

具体如下图:

1、dataset:

DataSet ds = new Select().From(Guardianf.Schema).ExecuteDataSet();
Grid1.DataSource = ds;
Grid1.DataBind(); 

 

2、查询方式:

SqlQuery q = new Select().From(Guardianf.Schema);
GuardianfCollection test = q.ExecuteAsCollection<GuardianfCollection>();
this.Grid1.DataSource = test;
this.Grid1.DataBind();

 

 

解决方法:SubSonic对大小写敏感,因此在写BoundField的DataField时,如果报错,需要看一下生成的表的Props代码段以确定是否DataField大小写有问题。

posted @ 2012-08-01 10:09  Ro_s__  阅读(244)  评论(0编辑  收藏  举报