Knowledge Base
Using A Stored Procedcure iin Forms
Last Post 08 Mar 2010 02:34 PM by DNNDev Admin. 3 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
regenbaumaUser is Offline
Basic Member
Basic Member
Posts:12
Avatar

--
04 Mar 2010 05:38 PM  
Can you give me an example or guidance how i can create and call an onsubmit related event so that upon submit I can execute a string of sql statements to inject content from that form submission to a sql table, or call a stored procedure using the form variables as parameters.

I have a xmpro tabel thats being populated on submit , but a I have anothe tabel table that needs that data too...
also thinking ..can i have multiple submit statements for that addform.... i suppose i could also define a trigger ... any suggestions welcome

Thanks !!
DNNDev AdminUser is Offline
Posts:5766
Avatar

--
04 Mar 2010 06:25 PM  
The best way is to use a stored procedure. To do this, use the EXEC command in your command text. So, if your stored procedure is called "AddContact" and takes two parameters "Name" and "Address", your SubmitCommand might look like this:

<SubmitCommand CommandText="EXEC AddContact @Name, @Address" />

In your form, presumably, you would have some fields tied to this parameters:

<TextBox id="txtName" DataField="Name" DataType="String" />
<TextArea id="taAddress" DataField="Address" DataType="String" />

Power Your Website With XMod Pro
Buy XMod Pro Today
regenbaumaUser is Offline
Basic Member
Basic Member
Posts:12
Avatar

--
08 Mar 2010 10:03 AM  
if i already had an insert statement in the submit woul dI need to move that to the stored procedure or can I just add a second submit command ?
DNNDev AdminUser is Offline
Posts:5766
Avatar

--
08 Mar 2010 02:34 PM  
You would need to move your INSERT statement into the stored procedure
Power Your Website With XMod Pro
Buy XMod Pro Today
You are not authorized to post a reply.

Active Forums 4.1
spacer
dummy