For more control over the database actions you will use the additional options in Display Setup under the "Form Data Options" section. In this section you can set the primary key, table name, connection string, etc.
Connection String: If you leave the Connection String empty the Forms DNN module will use your DNN database connection. To define your own connection you will enter that into this option in Display Setup.
There are sample connection strings you can use located at the bottom of Display Setup in the Tips and Tricks section. Don't forget to define the type of connection by checking "Use ODBC" or "Use OLE". If your database is
Microsoft SQL Server then you can leave those options unchecked.
Table Name and Primary Key: Providing a Table Name and Primary Key will override the defaults for the Forms module and your form. Note that the OnyakTech DNN Forms module will add columns for controls if a
column name matching the control name doesn't yet exist in the table. It will also add a primary key to the table if one is not found but only if the database is Microsoft SQL Server. The primary key must be an Identity, the seed
can be set to anything you wish it to be.
PK LookUp: (Primary Key LookUp) This option allows you to use SQL that will be executed to locate the primary key value that will be used to load the form data. The SQL Statement you use
is parsed which means you can use tokens in your SQL that include values from the current user if they are logged in, query string, cookies and the current users session values.
Form Load SQL Override: Enter custom SQL here to override the default method for loading data into your controls when the Form is loaded. All data columns will be mapped to matching Controls by name. For example, if you have a column named "Address" then you should also have a control named Address with the token [TEXTBOX-ADDRESS].
TSQL Execute After Submit: The TSQL Execute After Submit feature will execute the TSQL you enter into this option after a form is submitted. In the TSQL you can use value tokens to pass the form values submitted in your TSQL. For example, if you have a control on your form indicated as [TEXTBOX-MYNAME] and you want to pass that to a stored procedure after the form is submitted your TSQL would look something like the following: exec MyStoredProcedure @UserName=[MYNAME]; To pass the IDENTITY of the database transaction from Form Submit use the token [IDENTITY]