With H2O you can store data from an HTTP Form Post or from Query String parameters into new tables in your database with visual representation from an H2O Form.   To enable this feature, you need to connect your form to a table in your database by checking the Check to Connect option in the form details screen.  A screen shot of this is shown to the left.  You don't need to worry about this option for now since we will have H2O generate this form for us.

H2O will not generate tables or forms from an HTTP Post or Query String posting at any time.  This feature must be enabled and once H2O completes the setup of the table in your database and generates the form for you, this feature is automatically disabled.

To get started, we need to enable the HTTP Post Form Generator, to do this, click on Activate HTTP Post Form Generator from the main screen displayed in the H2O Forms Designer module.  After you click this option, H2O displays information on how to proceed.

The next step is to type the name you want H2O to create for this and then click the button as indicated in the image above.  H2O is now ready to accept the post and displays information on how to proceed along the URL you should use to post to. (Click here for the screen shot).

The URL given in this example is: http://onyaktechdev/DotNetNuke44/H2O/FormsDesigner/tabid/57/h20dx/AllowPostGen/Default.aspx

We will use the Query String method to generate this table by appending query string parameters FirstName and LastName to this URL. The values provided don't matter since H2O doesn't do anything with them, it just needs to know what fields to add to the table and the form to be generated. The end result will look like the following: http://onyaktechdev/dotnetnuke44/DeskTopModules/OnyakTech.H2O.FormsDesigner/httppost.aspx?h20dx=YmLRhDQrLgo|&FirstName=Mike&LastName=Miller

Note that H2O ignores the TabID and h2odx parameters.  After you paste your finished string into the web browser and hit Enter, you will be presented with a message stating that the table has been created in your database and the form has been generated for this form.  If you go back to the H2O Forms Designer, you should now see your new form visible in the list.

Now you're ready to put the form and/or table to use. If you open the from by clicking on the Edit link in the Forms List of the Forms Designer you will see new options and information available to you since this is an H2O Form that is directly associated with a table in your database.

The URL visible at the bottom of the Form Details screen is what you should use for future postings.  To test this out, use the URL provided and add the same Query String parameters we used to create the form.  An example: http://onyaktechdev/dotnetnuke44/DeskTopModules/OnyakTech.H2O.FormsDesigner/httppost.aspx?h20dx=YmLRhDQrLgo|&FirstName=Mike&LastName=Miller

After this post, you should now see something that looks like the image below with a record count of 1.  To view the RAW data in your table, click on the View Table Records.



Copyright 2009 by OnyakTech
Privacy StatementTerms Of Use