Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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#.
Posted

1 solution

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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900