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
Israel
699
1.3k
215.6k
Forced to insert code before saving
Nov 14 2016 5:59 AM
Hi!
When I want to save I receive this message. After that its pass to saving process. How can I do to doesnt allow to save without insert the code. Mean before to save its should forced to insert code. How to do it please.
if (txtCode.Text == "")
MessageBox.Show("Please insert the code");
if (conn.State != ConnectionState.Open)
conn.Open();
//conn.Open();
OleDbCommand comm = new OleDbCommand();
comm.Connection = conn;
connstr = "SELECT COUNT(*) FROM company_anex WHERE [company] = @company";
comm.CommandText = connstr;
comm.Parameters.Clear();
comm.Parameters.AddWithValue("@company", cbxCompanyConfigEmp.Text);
int numRecords = (int)comm.ExecuteScalar();
if (numRecords == 0)
{
connstr = "INSERT INTO company_anex([company])VALUES(company)";
comm.CommandText = connstr;
comm.Parameters.Clear();
comm.Parameters.AddWithValue("@company", cbxCompanyConfigEmp.Text);
comm.ExecuteNonQuery();
MessageBox.Show("Saved ..");
}
conn.Close();
Reply
Answers (
1
)
Auto Updation of UWP app inside the Windows 10 iot Core Rasp
date problem for not recognized