<br /> dateTimePicker1.Format = DateTimePickerFormat.Custom;<br /> dateTimePicker1.CustomFormat = "dd/MM/yyyy";<br /> dateTimePicker2.Format = DateTimePickerFormat.Custom;<br /> dateTimePicker2.CustomFormat = "dd/MM/yyyy"; <br /> <br /> DateTime date = dateTimePicker1.Value;<br /> this.Text = date.ToString();<br /> DateTime date1 = dateTimePicker2.Value;<br /> this.Text = date1.ToString();<br /> <br /> <br /> <br /> SqlConnection myConnection = new SqlConnection("Server=(local);Database=ERP2014-2015;Trusted_Connection=True;");<br /> myConnection.Open();<br /> <br /> <br /> <br /> using (SqlConnection connection = new SqlConnection(connectionString))<br /> {<br /> <br /> SqlCommand myCommand = new SqlCommand();<br /> myCommand.CommandText = "INSERT INTO dbo.ComapnyName([CompanyName], [GovermentID], [RegistrationNumber], Address1, Address2, PostalCode, City, FromDate, ToDate) VALUES ('" + textBox2.Text + "','" + textBox3.Text + "','" + textBox4.Text + "','" + textBox5.Text + "','" + textBox6.Text + "','" + textBox8.Text + "','" + textBox7.Text + "," + date.ToString() + "," + date1.ToString() + "')";<br /> <br /> <br /> <br />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)