Adhikar Patil

Adhikar Patil

  • NA
  • 481
  • 128.3k

How to filter dataset using Between for two dates

Jul 31 2018 8:47 AM
I have an Table StudentMaster
 
FirstName nvarchar(50)
LastName nvarchar(50)
SignupDate date
 
And Records in that table is
 
FirstName         LastName     SignupDate
Adhikar             Patil              2018-05-10
Sunny                Patil              2018-03-25
Shastri               Patil              2018-07-28
 
And now i want to filter dataset using between two dates
 
DataView dataView = ds.Tables[0].DefaultView;
dataView.RowFilter = "SignupDate >='" + Convert.ToDateTime(txtFMinDate.Text).ToString("dd/MM/yyyy") + "'" + " AND SignupDate <='" + Convert.ToDateTime(txtFMaxDate.Text).ToString("dd/MM/yyyy") + "'";
 
But i am not getting proper result. Please tell me the solution

Answers (3)