验证起始日期和起始日期必须相同 [英] Validate the From date and excel date must be same
问题描述
在运行模式下如下
从日期起Calendar1到日期Calendar2导入(按钮)
在excel记录如下
日期课程课程学院
18-Aug-14 RMFA 1 DOC
18 -Aug-14 MC 2 DRS
19-Aug-14 SSO 3 BSR
19-Aug-14 EFA 4 MJ
19-Aug -14 SSO 5 BSR
19-Aug-14 EFA 6 MJ
我有一个Gridview作为关闭
当用户点击导入按钮时,上面的excel记录将显示在Gridview中。
在Gridview记录如下
日期课程课程学院
18-Aug-14 RMFA 1 DOC
18 -Aug-14 MC 2 DRS
19-Aug-14 SSO 3 BSR
19-Aug-14 EFA 4 MJ
19-Aug-14 SSO 5 BSR
19-Aug-14 EFA 6 MJ
我想验证用户必须从calendar1和excel中选择From日期18-Aug-14
第2行必须是18-Aug-14 date。 />
根据您的理解,我写的内容如下
Fromdate选择日期和excel第二行日期必须是相同。
为此我怎样才能使用C#在asp.ent中验证。
In run mode as follows
From date Calendar1 To date Calendar2 Import (Button)
In excel records as follows
Date Course Session Faculty
18-Aug-14 RMFA 1 DOC
18-Aug-14 MC 2 DRS
19-Aug-14 SSO 3 BSR
19-Aug-14 EFA 4 MJ
19-Aug-14 SSO 5 BSR
19-Aug-14 EFA 6 MJ
I have one Gridview as follows
When user click the Import Button, The above excel records will be displayed in Gridview.
In Gridview Record as follows
Date Course Session Faculty
18-Aug-14 RMFA 1 DOC
18-Aug-14 MC 2 DRS
19-Aug-14 SSO 3 BSR
19-Aug-14 EFA 4 MJ
19-Aug-14 SSO 5 BSR
19-Aug-14 EFA 6 MJ
I want to validate user has to select the From date 18-Aug-14 from the calendar1 and in excel
2nd row must be 18-Aug-14 date .
For your understanding i am writing as follows
Fromdate selected date and in excel 2nd row date must be the same.
For that how can i validate in asp.ent using C#.
推荐答案
请完成以下步骤。
1.读取数据表中的excel文件。
2.一次数据在数据表中然后使用datatable.select根据您的验证条件过滤数据。
3.将过滤后的数据放入另一个数据表并将其与您的gridview绑定。
希望以上步骤有所帮助。
Please go through the below steps.
1. Read the excel file in the datatable.
2. Once the data is in the datatable then filter the data basing on your validation condition using datatable.select.
3. Put the filtered data in another datatable and bind that with your gridview.
Hope the above steps helps.
这篇关于验证起始日期和起始日期必须相同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!