Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to write a SQL Insert statement
Message
 
To
05/05/2004 19:55:41
Bill Benton
North Florida Software Services
Middleburg, Florida, United States
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Miscellaneous
Thread ID:
00901418
Message ID:
00901909
Views:
13
>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();

// TODO: Put code here to store values from the web controls to the properties of the default values object

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
Previous
Reply
Map
View

Click here to load this message in the networking platform