private void button1_Click(object sender, EventArgs e) { //Insert the file into database SqlConnection cn = new SqlConnection(@"Data Source=SAZ-PC\SQLEXPRESS;Initial Catalog=Voted;Integrated Security=True"); SqlCommand cmd = new SqlCommand("INSERT INTO tblUser VALUES(@ID_NUMBER, @FIRSTNAME, @LASTNAME, @FINGERPRINT, @DATE_ADDED, @DATE_MODIFIED)", cn); cmd.Parameters.Add("ID_NUMBER", SqlDbType.NVarChar).Value = textBox1.Text; cmd.Parameters.Add("FIRSTNAME", SqlDbType.NVarChar).Value = textBox2.Text; cmd.Parameters.Add("LASTNAME", SqlDbType.NVarChar).Value = textBox3.Text; cmd.Parameters.Add("FINGERPRINT", SqlDbType.Image).Value = bytes; cmd.Parameters.Add("DATE_ADDED", SqlDbType.DateTime).Value = DateTime.Now; cmd.Parameters.Add("DATE_MODIFIED", SqlDbType.DateTime).Value = DateTime.Now; cn.Open(); cmd.ExecuteNonQuery(); cn.Close(); textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; MessageBox.Show("Successfully Registered"); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)