i had take two textbox on window form and i want all dates between that two textbox
date format in database id "dd/mm/yyyy"
How to take date from database between two textbox"dd/mm/yy"
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Manoj BhoirRank #599 · 4K pointsPosted May 9, 2015, 6:46 AM EDT
You can use below SQL Query to Select Data From Database for specific date range.
Select * From TableName Where DateColumnName BETWEEN 'YYYY-MM-DD' AND 'YYYY-MM-DD'
// Assumes that connection is a valid SqlConnection object.
string queryString = "SELECT Column1, Column2 FROM TableName";
SqlDataAdapter adapter = new SqlDataAdapter(queryString, connection);
DataSet data = new DataSet();
adapter.Fill(data);
g s102 pointsPosted May 11, 2015, 4:35 AM EDT
Fully Explain With Screen Shots Below Links
http://dotnetdrizzles.blogspot.com/2015/05/compare-two-dates-in-between-sql-query.html
http://screenshotdrizzles.blogspot.in/2015/05/compare-two-dates-in-between-sql-query.html