private void btnSave_Click(object sender, EventArgs e) { if (txtTitle.Text != null && txtAuthor.Text != null && txtPublisher.Text != null && txtYear.Text != null) { dbCon1.Execat("INSERT INTO existbooks(Title, Author, Publisher, YearPublish, Price, Cover)" + $"VALUES ('{txtTitle.Text}','{txtAuthor.Text}','{txtPublisher.Text}','{txtYear.Text}', '{txtPrice.Text}', '{picCover.Image}') "); MessageBox.Show("Save data successfull!"); } else if (txtTitle.Text == null | txtAuthor.Text == null | txtPublisher.Text == null | txtYear.Text == null) { MessageBox.Show("Error!"); } }
private void btnSave_Click_1(object sender, EventArgs e) { dbCon.Execat("INSERT INTO users(name, surname, dateB, login, password)" + $"VALUES ('{txtName.Text}','{txtSurname.Text}','{dateBirth.Text}','{txtUsername.Text}','{txtPassword.Text}') "); MessageBox.Show("Registered Successfully"); }