protected void Button1_Click(object sender, EventArgs e)
{
DateTime date1 = DateTime.ParseExact(Txt_refd.Text, "yyyy-MM-dd", null);
DateTime date2 = DateTime.ParseExact(Txt_out.Text, "yyyy-MM-dd", null);
using (var command = new SqlCommand())
{
command.CommandText = "INSERT INTO FZMain (ID, NAME, ChassisNO, CarModel, LastOwner, Payment, Cases, Refference, RefferenceDate, OutDate, FamilyRegister) " +
"VALUES (@ID, @NAME, @ChassisNO, @CarModel, @LastOwner, @Payment, @Cases, @Refference, @RefferenceDate, @OutDate, @FamilyRegister)";
command.Connection = con;
command.Parameters.AddWithValue("@ID", Txt_ID.Text);
command.Parameters.AddWithValue("@NAME", Txt_name.Text);
command.Parameters.AddWithValue("@ChassisNO", Txt_chasses.Text);
command.Parameters.AddWithValue("@CarModel", Txt_model.Text);
command.Parameters.AddWithValue("@LastOwner", Txt_owner.Text);
command.Parameters.AddWithValue("@Payment", Txt_payment.Text);
command.Parameters.AddWithValue("@Cases", Drop_case.SelectedValue.ToString());
command.Parameters.AddWithValue("@Refference", Txt_ref);
command.Parameters.AddWithValue("@RefferenceDate", date1);
command.Parameters.AddWithValue("@OutDate", date2);
command.Parameters.AddWithValue("@FamilyRegister", Txt_femreg.Text);
// Carry on from this point
}
}
-saige-
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE