public Guid InsertCustomer(string Contact, string Company, string Address1, string Address2, string City, string State, string Zip, string Phone, string Email) { CustomersTableAdapter ta = new CustomersTableAdapter(); Guid newPK = Guid.NewGuid(); int results = 0; results = ta.Insert(newPK, Contact, Company, Address1, Address2, City, State, Zip, Phone, Email, DateTime.Now, DateTime.Now); if (results <= 0) newPK = Guid.Empty; return newPK; }
/// <summary> /// Insert new order /// </summary> /// <param name="dr">data row</param> /// <returns>ID of new record</returns> public int InsertNewOrder(OrdersDataSet.OrdersRow dr) { int retVal; using (OrdersTableAdapter ta = new OrdersTableAdapter()) { dr.OrderPk = Guid.NewGuid(); retVal = (int)ta.InsertNewOrder(dr.OrderPk, dr.CustomerFK); } return retVal; }So, it looks like you need to get a reference to the DataRow and then you can access fields of this row and assign them values.