This is A C# Practice code:
Video For Result:
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.Data.SqlClient;
- namespace dataentry
- {
- public partial class UserLogin : Form
- {
- public UserLogin()
- {
- InitializeComponent();
- }
- SqlConnection asdf = new SqlConnection("Data Source=.;Initial Catalog=dataentry;Integrated Security=True;Pooling=False");
- private void button1_Click(object sender, EventArgs e)
- {
- CON.Open();
- SqlDataAdapter SDA = new SqlDataAdapter("INSERT INTO REGISTER (ID,NAME,GENDER,STATUS,AGE,SALARY,TAX,DOB) VALUES ('" + textBox1.Text + "','" + textBox2.Text + "','" + comboBox1.Text + "','" + comboBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','"+this.dateTimePicker1.Text+"')", CON);
- SDA.SelectCommand.ExecuteNonQuery();
- CON.Close();
- MessageBox.Show("SAVED SUCCEESSFULLY !!!!!");
- button4_Click(sender, e);
- }
- }
- }
Facebook Comment