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.2k
This is my code but result is null.
May 6 2017 3:57 AM
Is any wrong here?
private void btnSearch_Click(object sender, EventArgs e)
{
con = new OleDbConnection(conString);
var query = "SELECT * FROM LalData " +
" WHERE " +
"SuspenceAccount = @suspenceAccount " +
"AND " +
"PaymentDate BETWEEN @startDate AND @endDate ";
con.Open();
OleDbCommand cmd = new OleDbCommand(query, con);
cmd.Parameters.AddWithValue("@startDate ", DbType.Date).Value =
dtpStartDate.Value.ToShortDateString();
cmd.Parameters.AddWithValue("@endDate ", DbType.Date).Value =
dtpEndDate.Value.ToShortDateString();
cmd.Parameters.AddWithValue("@suspenceAccount ", DbType.String).Value =
comboBox2.SelectedItem.ToString();
adapter = new OleDbDataAdapter(cmd);
adapter.Fill(dt);
dataGridView1.DataSource = dt;
dataGridView1.CurrentCell = dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells[0];
con.Close();
}
Reply
Answers (
3
)
News Bind Based on date
This request requires matching csrf cookie and header error