【发布时间】:2016-04-17 22:58:56
【问题描述】:
我正在通过 asp.net 网络表单中的网格制作搜索列表。 我正在使用 Web 服务来加载网格。现在我怎样才能提高请求日期?
gvproposal.DataSource = webservice.EnquiryGetAllLcRequest();
gvproposal.DataBind();
这里我只是简单的绑定了web服务现在怎么升日期??
public IS_LC_REQUEST[] EnquiryGetAllLcRequest();
这是网络服务方法。
public class IS_LC_REQUEST : CModelBaseOfIS_LC_REQUEST
{
public IS_LC_REQUEST();
public string BENEFICIARY_ADDRESS { get; set; }
public string BENEFICIARY_NAME { get; set; }
public string BRANCH_ID { get; set; }
public string PORT_OF_SHIPMENT { get; set; }
public string REQUEST_DATE { get; set; }
public string REQUEST_ID { get; set; }
}
更新:
var arrayOfObjects = IntBankProposal.EnquiryGetAllLcRequest();
var dt = DateTime.Now;
gvproposal.DataSource = arrayOfObjects.OrderBy(load => { if (DateTime.TryParse(load.REQUEST_DATE, out dt)) { return dt; } else { return DateTime.Now.AddYears(-100); } }).ToArray();
gvproposal.DataBind();
【问题讨论】:
-
你不能在 Sql 中这样做吗?
-
也显示
EnquiryGetAllLcRequest()的代码? -
没有 ..im 使用 oracle。
-
我的意思是您可以在从哪里加载记录的查询中执行此操作。
-
webservice.EnquiryGetAllLcRequest() 是否返回数据表?
标签: asp.net date datetime webforms