TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Shovan Saha
NA
321
91.9k
StartDate and EndDate data select in datagridview
Mar 18 2017 4:28 PM
I have MS access database and form C# windows application managed by visual studio 2015. PaymentDate is a column name. I want to select from datagridview StartDate and EndDate with text box or datetimepicker using search button. But within a month it is good. But when I select one month to another month then it select full database. Here is my code:
private void btnSearch_Click(object sender, EventArgs e)
{
con = new OleDbConnection(conString);
string sql = "SELECT * FROM LalData WHERE PaymentDate between '" + txtStartDate.Text.ToString() + "' AND '" + txtEndDate.Text.ToString() + "'";
con.Open();
adapter = new OleDbDataAdapter(sql, con);
dt = new DataTable();
adapter.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
btnSubmit.Enabled = false;
}
Reply
Answers (
2
)
UWP not working in Xamarin Crossplatform project.
C# GUI Interface