Join our DNN Community    (Newsletter, Tips, Tricks and Forums for DNN Skins & Modules)

 


 
Microsoft Gold Certified Partner - DNN Benefactor

DotNetNuke Powered! 


Tuesday, January 06, 2009 Register · Login · Contact · Search:  
Company Solutions Portfolio Contact
Forums
General
Forum for discussing Dotnetnuke and asking or answering questions regarding general usage, integration and fundamentals
Subject: Updating a database with ListX - PLEASE HELP
You are not authorized to post a reply.
 
Author Messages
leahdugue
Featherweight
Posts:7

09/13/2006 10:25 AM Alert 
I am trying to update a database with ListX.  What  should I do?  So far, this is the code I have in the Header section under Format:

Last Name First Name
Thank you very much!
kevinmschreiner
Please Wait...
Posts:749

09/14/2006 5:20 PM Alert 
Okay, so we have two form elements: NewLastName and NewFirstName.

First - add two Variables in the Control panel. Their type is Form, and their names are NewLastName and NewFirstName. Set the Left and Right Padding to single quote ', and set the Empty target to NULL. Also set the Target of the replacement values to @NewLastName and @NewFirstName.

Next, Add a button, or a Link to your page which will submit the data. For the example - lets place a link -
Save

Okay - now - you need to create the Action script to save your data. If you loaded the record from an existing record, you will need that value, but for this example, it appears you desire the ability to INSERT a new record.

1. Add a message action - ACTION:Message with a Type, Toolbar and a Name Save which acts as the listener for our link click.
2. As a child of the Message Action we just added - Add an ACTION:Execute, setting the Name of the execution to NEWRECORD and the Query to your insert statement - for example:

INSERT INTO myTable(FirstName,LastName) VALUES (@NewFirstName,@NewLastName)
SELECT SCOPE_IDENTITY() newID

I assumed that myTable would have a primary key, and I returned that here. If you need to do something with that identity value - you have access to it via the ListX tag [newID,NEWRECORD].

Got it?

Kevin M Schreiner

Business Intelligence Force, Inc. (bi4ce)
leahdugue
Featherweight
Posts:7

09/15/2006 12:14 AM Alert 
Thank you very much!  I really appreciate it. 
Leah
You are not authorized to post a reply.
Forums > Dotnetnuke > General > Updating a database with ListX - PLEASE HELP



ActiveForums 3.6
Latest Post
 
At R2integrated (formerly Bi4ce), we take support seriously.  That's why we support our customers and DNN community with daily monitoring from our experienced engineering team.  We ask that the first step taken is to read the relevant documentation and support forums prior to submitting any questions that may already be available or have been answered.  We ask that you review the documentation that we provide for our products before posting a question.

The Forums are for our customers to chat, exchange ideas and strategies, and submit feedback.  Please be sure to perform keyword searches for previous related forum responses.

To be helpful when submitting a new item, please include the following: 
  1. DNN Version
  2. Module Version
  3. Admin Log Viewer Information
  4. Environment detail: Operating system, .NET framework version, database and version, IIS version, Browser version (if appropriate)
We always try to respond quickly and monitor the forums daily during business hours (EST).  Occasionally, requests for a specific project requirement may not apply for the free support offered. For project specific support please submit via our Information Request form.

Thank you for using our Forums.

Click here to register for the Forums
 
© 2008 by R2integrated (formerly Bi4ce) | DNN® is a registered trademark of DotNetNuke Corporation