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
92.6k
Please check my code
Aug 3 2017 12:52 PM
Dear All, This code is for searching empty cells of certain column. Now I want to search not empty cells of certain column. Please help me.
Here is my code:
if (comboBoxEnterSuspenseAccount.Text != "")
{
con = new OleDbConnection(conString);
var query6 = "SELECT * FROM LalData " +
" WHERE " +
"SuspenseAccount = @suspenceAccount1 " +
"AND[CibtcaNo] = '" + DBNull.Value + "'" +
"AND " +
"(PaymentDate BETWEEN @firstDate AND @lastDate)";
con.Open();
OleDbCommand cmd = new OleDbCommand(query6, con);
cmd.Parameters.AddWithValue("@suspenceAccount6 ", DbType.String).Value = comboBoxEnterSuspenseAccount.Text.ToString();
cmd.Parameters.AddWithValue("@firstDate ", DbType.Date).Value =
dtpFirstDate.Value.ToShortDateString();
cmd.Parameters.AddWithValue("@lastDate ", DbType.Date).Value =
dtpLastDate.Value.ToShortDateString();
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
)
C# search only not empty cell
Microsoft Excel formula