//依据批次去查询 private void XSFile(string AttachmentBatch_Guid) { string StrselectFile = "SELECT max(AttachmentBatch_Guid) as AttachmentBatch_Guid, FileName,max (CreatedDate) as CreatedDate " + " FROM SSysAttachment where AttachmentBatch_Guid = '" + AttachmentBatch_Guid + "' Group by FileName"; DataTable AbjunctTable = db.GetDataTable(StrselectFile); GVAbjunct.DataSource = AbjunctTable; GVAbjunct.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { string AttachmentBatch_Guid = "56e24e8a-3380-4ca8-827e-1fc17574978b"; string StrselectFile = "SELECT max(AttachmentBatch_Guid) as AttachmentBatch_Guid, FileName,max (CreatedDate) as CreatedDate " + " FROM SSysAttachment where AttachmentBatch_Guid = '" + AttachmentBatch_Guid + "' Group by FileName"; DataTable AbjunctTable = db.GetDataTable(StrselectFile); GVAbjunct.DataSource = AbjunctTable; GVAbjunct.DataBind(); } }