




SqlComBldDet = new SqlCommandBuilder(sqlDataDet) SqlComBldMaster = new SqlCommandBuilder(sqlDataMaster) string id = command.ExecuteScalar().ToString() Ĭommand = new SqlCommand("UPDATE Orders SET CustomerID = OrderDate = ShippedDate = WHERE OrderID = SqlDbType.NVarChar, 15, "OrderID").Value = SqlDbType.VarChar, 15, "CustomerID").Value = SqlDbType.DateTime).Value = SqlDbType.DateTime).Value = dtShipDt.Text ĬommandDet = new SqlCommand("INSERT INTO OrderDetails (ProductID, UnitPrice, Quantity) VALUES SqlDbType.NVarChar, 15, "OrderID").Value = txtOrdID.Text SqlDbType.NVarChar, 5, SqlDbType.VarChar, 50, SqlDbType.VarChar, 20, "Quantity") ĬommandDet = new SqlCommand("UPDATE OrderDetails SET ProductID = UnitPrice = Quantity = WHERE OrderID = SqlDbType.NVarChar, 15, "OrderID").Value = txtOrdID.Text SqlDbType.NVarChar, 5, SqlDbType.VarChar, 50, SqlDbType.VarChar, 20, "Quantity") SqlDataDet = new SqlDataAdapter(qryOrdDet, sqlConnection) Ĭommand = new SqlCommand("INSERT INTO Orders ( CustomerID, OrderDate, ShippedDate) VALUES SELECT SqlDbType.NVarChar, SqlDbType.VarChar, =dtShipDt.Text SqlDataMaster = new SqlDataAdapter(qryOrd, sqlConnection) QryOrdDet = "Select OrderID, ProductID, UnitPrice, Quantity from OrderDetails" QryOrd = "Select OrderID, CustomerID, OrderDate, ShippedDate from Orders" SqlConnection = new SqlConnection(connectionString) In the form load event I've the following code: private void Inv2_Load(object sender, EventArgs e)ĬonnectionString = ConfigurationManager.AppSettings I've create a form for order entry, which contain a textbox for OrderID, a combobox for Customer, DateTimePickers for OrderDate and ShippedDate and a DataGridView which contains columns OrderID (readonly), ProductID, UnitPrice & Quantity. Sample Database = NorthWind (Tables Orders and OrderDetails).I need some help to make a order form in C#.
