积极答复者
自定义页面绑定的问题?

问题
答案
全部回复
-
-
我是把GridView的数据源直接设置为BusinessEntities[] 了代码大概如下:
gv.DataSoruce= this.QueryStock();
gv.DataBind();
public BusinessEntity[] QueryStock(string wareId, string productId)
{... ...
BusinessEntityCollection wareproduct = service.RetrieveMultiple(query);
return wareproduct.BusinessEntities;}
碰到int、money、picklist或lookup等类型时就傻眼了啊??如何处理啊?
-
DataTable dt=new DataTable();
dt.AddColumn(...);
dt.AddColumn(...);
foreach (BusinessEntity be in wareproducts )
{
DataRow row=dt.NewRow();
row["xxx"]=((wareproduct)be).xxx.value;
dt.AddRow(row);
}
类似这样写.
这样搞就晕菜了,开发速度慢不说,性能还低,查一次还的转一次;
NND,惹毛了我直接在数据库里写几个store procdures,然后sqlconnection 过去算了,有没有这么搞的啊 ??