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
Jul 26 2017 3:17 PM
Dear All, I have a combobox, two dtp(will find in one col) and a dgv. I want the result, when I shall press btn then dgv will appear that 10th col ("CibtcaNo") of dgv are filled.
private void btnAdjusted_Click(object sender, EventArgs e)
{
if ((comboBoxEnterSuspenseAccount.Text.ToString() != "") && (dataGridView1.Rows[dataGridView1.Rows.Count - 1].Cells["CibtcaNo"].Value.ToString() != ""))
{
con = new OleDbConnection(conString);
var query = "SELECT * FROM LalData " +
" WHERE " +
"SuspenseAccount = @suspenceAccount1 " +
"AND " +
"(PaymentDate BETWEEN @firstDate AND @lastDate)";
con.Open();
OleDbCommand cmd = new OleDbCommand(query, con);
cmd.Parameters.AddWithValue("@suspenceAccount1 ", DbType.String).Value = comboBoxEnterSuspenseAccount.Text.ToString();
cmd.Parameters.AddWithValue("@fromDate ", DbType.Date).Value =
dtpFirstDate.Value.ToShortDateString();
cmd.Parameters.AddWithValue("@toDate ", 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 (
1
)
Value From my asp.net or html page to any other website ifra
How to access free Trail in Azure?