>I am attempting to write a SQL insert statement, but not having too much luck. I am attempting to write it as a business object, and modeling it based on the code below. I am capturing the data from a web page, from lookups and data entered into text boxes. I do not want to write the record into the main table until all data is validated on the web page, and insert it all ay once to create the master record. I intend passing the data to the business object as parameters, returning the new dataset. This is holding up my whole project.
I'm not sure understand the scenario, but if you're looking to add a new row to a DataSet and intend on passing the values as parameters, you can use the business object's NewRow method to do this. Check out the MM .NET Dev Guide topic "Setting Default Values in New Rows" for details, but the gist is:
1. Create a Default Value parameter class
2. Capture the data from the web page and store it in the parameter object
3. Call the business object's NewRow() method, and pass an instance of this object to the method
Here's an example that adds the new row to an empty Orders DataSet:
OrderDefaultValues OrderDefaults = new OrderDefaultValues();
Orders.GetEmptyDataSet();
Orders.NewRow(OrderDefaults);
Orders.SaveDataSet();
Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com