var command = "insert into User values(@Emp_Id,@Honorific,@F_Name,@L_Name,@Password,@Designation,@Level,@Email,@Mobile,@Department,@Date_Joining,@Creation_Date)";
using (SqlConnection cnn = new SqlConnection(cnnString))
{
using (SqlCommand cmd = new SqlCommand(command, cnn))
{
cmd.Parameters.AddWithValue("@Emp_ID", TB_EC_NO.Text);
cmd.Parameters.AddWithValue("@Honorific", DD_Honorific.SelectedValue);
cmd.Parameters.AddWithValue("@F_Name", TB_First_Name.Text);
cmd.Parameters.AddWithValue("@L_Name", TB_Last_Name.Text);
cmd.Parameters.AddWithValue("@Password", TB_Password.Text);
cmd.Parameters.AddWithValue("@Designation", DD_Designation.SelectedValue);
cmd.Parameters.AddWithValue("@Level", "Level");
cmd.Parameters.AddWithValue("@Email", TB_Email.Text);
cmd.Parameters.AddWithValue("@Mobile", TB_Mobile.Text);
cmd.Parameters.AddWithValue("@Department", DD_Department.SelectedValue);
cmd.Parameters.AddWithValue("@Date_Joining", DateTime.Now);
cmd.Parameters.AddWithValue("@Creation_Date",DateTime.Now);
cnn.Open();
cmd.ExecuteNonQuery();
}
}