have made changes in the InsertData() function. Try this. Also add some exceptional handling and connection management.
private void InsertData()
{
sql = "INSERT INTO Order_Table(orderID, Name, madeIn)
VALUES(@txtOrderID, @txtName, @txtMadeIn)";
string conStr = "Data Source=.\SQLEXPRESS;
AttachDbFilename=|DataDirectory|\Order.mdf;
Integrated Security=True; User Instance=True";
connection = new SqlConnection(conStr);
connection.Open();
command = new SqlCommand(sql, connection);
command.Parameters.AddWithValue("txtOrderID", Convert.ToInt32(txtOrderID.Text));
command.Parameters.AddWithValue("txtName", txtName.Text);
command.Parameters.AddWithValue("txtMadeIn", txtMadeIn.Text);
int result = (int)command.ExecuteNonQuery();
if (result != -1)
{
MessageBox.Show("Add Data Completed");
}
else
{
MessageBox.Show("Error ! !&");
}
connection.Close();
}