Great Ideas. Always Flowing.

We are not happy until you are happy. Client satisfaction guaranteed. Whatever your needs and requirements, we have the skills and resources for the job!

Quick login...


Or... now make it easy with Facebook Integration
Connect via Facebook



Top Sellers

Frustrated over the lack of customization for your user's registration fields? Dynamically setup your DNN Portal with custom registration fields, layout, questions, and other core integration options......

Ultra Video Gallery is a brother product of Ultra Media Gallery, UVG allows you to upload videos in various format and automatically encode them to flv or H264 format, you also can add videos from internet or record live videos from your webcam.

Build high performance, completely customizable data-entry forms and views driven by your DNN and external databases. New built-in tools make it a snap to quickly create data entry forms, data views, and even database tables. Plus, add your own HTML, CSS, Javascript, SQL commands, stored procedures,

The most advanced DotNetNuke shopping cart on the planet. Easy to use e-Commerce, Secure Shopping Cart Software and SEO friendly. B2C / B2B Ecommerce Sites.

One stop solution for events calendar and events registration! FREE DOWNLOAD is available now!

Populate SQL Driven Combo Box with Querysting Variable.
Last Post 04-09-2009 12:47 PM by jerops. 20 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
jeropsUser is Offline
river guide
river guide
Posts:99
Avatar

--
04-03-2009 11:51 AM

    Hi,

    I'm tyring to send a querystring variable to my page with DR on it.  And I can get all my other fields, Username, FirstName, etc...to populate...but I can't seem to get my Combo Box (which uses SQL to populate the choices) to pick the querystring variable.

    I've made sure that my shortname matches the variable in the querystring.  And I've made sure to check to retrieve values from querystring variable for this question:

    This field is attached to a custom profile field that I created using DNN Users tools for doing that.  It appears as a choice in the dropdown when I want attach to a DNN field.

    Am I missing something?  Does anyone have a suggestion on how I could get this to work?

    Thanks,
    Jerry

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-03-2009 12:43 PM
    Can you type in your SQL statement for the combo box here? Also, the querystring variable that is being passed. -- David
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-03-2009 12:54 PM
    Yes here it is:
    select SchoolName as QuestionOption, SchoolName as QuestionOptionValue from OPS_SCHOOL_LIST Order by SchoolName ASC

    and the shortname fiels and varialble is both SA

    Thanks for looking into this..
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-03-2009 01:06 PM

    Jerry, on drop down combo box using SQL query, you need to specify a where clause as well. Try this:
    select SchoolName as QuestionOption, SchoolName as QuestionOptionValue from OPS_SCHOOL_LIST where columnname = '$(SA)'

    Replace columnname with the name of the column from your OPS_SCHOOL_LIST table that you want to retrieve. If this works, then put in the "Order by Schoolname ASC" afterwards. -- David

    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-04-2009 10:32 AM
    David, I've tried that and it doesn't bring up my list...I clicked on the test SQL and it came up with zero rows(Which I think it should since it needs the variable) I've double checked to make sure that i'm passing the variable SA and I am. It seems like DR is not picking it up. Although it is picking up my other ones that are tied to textboxes.

    Do have any other ideas I could try?

    Thanks for you help, I really appreciate it.
    Jerry
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-04-2009 01:53 PM
    Okay, Jerry do this.
    1) create a textbox field with same shortname as the querystring, called "SA"; retrieve the value of this from querystring
    2) rename your combobox to something else
    3) use the SQL query just like I had from above
    select SchoolName as QuestionOption, SchoolName as QuestionOptionValue from OPS_SCHOOL_LIST where columnname = '$(SA)'

    If this works, then change your textbox field (1) to a hidden field. I believe this should do the trick. Problem with retrieving combobox from querystring, yet set the default to an SQL driven option is that the retrieve from querystring will dominate if it's present and yield whatever querystring you're passing. Anotherwords, the SQL option to retrieve values from database will be preempted. -- David
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-04-2009 07:41 PM
    Okay, I did number 1) and it retrieved the SA variable correctly.
    On number 2) I renamed the shortname on the combo box to SchAtt not SA.
    3) on the combo box, I used the SQL as suggested and it didn't work, so in the textbox I used the same SQL...with no effect.

    On the combo box, I've tried toggling retrieve by querystring on and off and still can't get it to work...

    Did I follow you instructions incorrectly?

    Jerry
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-06-2009 08:18 AM
    Hi,

    I've decided that since I can't get the SQL Driven combo box to pickup the querystring parameters, that I would manually enter the choices and not use SQL Driven option.. This has worked, however, when I try to update a registration, I get the following error:

    DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DataSprings.Modules.DynamicRegistration.DynamicRegistration.AddUpdateUser() at DataSprings.Modules.DynamicRegistration.DynamicRegistration.ExecuteRegistration(Boolean ProcessPaymentNotification, String strResponseID) at DataSprings.Modules.DynamicRegistration.DynamicRegistration.lnkRegister_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) --- End of inner exception stack trace ---
    Source:

    That's what appears in the log, the short error message on the page shows up as: Object reference not set to an instance of an object.
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-06-2009 10:36 AM
    Okay...I've started over and now I can get the combo box that are SQL Driven to populate with querystring parameter. But now I'm running into an error. I probably left this out...but I'm using this module so a non-administator could possibly update a students school that they are attending...So I have and IndooGrid module, which displays in a SQL Grid View the students available, then passes the parameters to DR via querystring.

    Now it's all working, the correct parameters are being passed to the correct controls, however, when I click update registration I get a A critical error has occurred.
    Value cannot be null. Parameter name: format

    Is this because I'm logged in as the portal host looking at a student's user profile and even though, I passed the UserID, it's trying to update the Host UserID?

    Thanks for helping me out with this, I really do appreciate it.
    Jerry
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-06-2009 04:14 PM
    I've gone back and clicked on all fields to 'do not update database' in the advance settings. I've then setup completion events to update the users table and UsersProfile table based on the userID, but I still get the A critical error has occurred.
    Value cannot be null. Parameter name: format

    I'm not sure what this is talking about...

    Again, appreciate any tips or suggestions to get this working, or if this not possible, please let me know.

    Thanks again for taking the time to help.
    Jerry
    Chad NashUser is Offline
    Posts:5260
    Avatar

    --
    04-06-2009 05:40 PM
    Jerry,

    What do you have specified under DNN Core Integration for username, password, and confirm password? Are these fields all visible on your page?

    Chad
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-06-2009 07:34 PM
    Chad,

    I have the Username, password, and confirm password all mapped to controls/questions on the module, but they are marked as hidden fields and 'do not save to database'.

    Jerry
    CandaceUser is Offline
    river guide
    river guide
    Posts:2431
    Avatar

    --
    04-07-2009 09:51 AM

    Hi Jerry,

    If you want to hide these fields, you cannot hide these on the question level as these are considered 'user credentials' that DNN requires.  Please take these settings out (including the do not save to db).  Then, please go to DNN Core Integration and expand the Advanced Core Integration Options.  You'll find settings there pertaining to Hide Fields.

    Something else to think about:  do you not want your users to enter their own username and password?  If so, you can just select the option to Auto Create User ID, again under Advanced Core Integration.  Just remember that you still need the username & password fields on the form, it will just be hidden.  Hope that helps!

    Candace

    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-07-2009 11:40 AM

    Thanks, candace that did help!  I'm not getting the error any more!

    Now I'm running into a new error and hopefully you have a good suggestion....I'm running a completion event to run only on update registration using the following SQL

    UPDATE Users SET DisplayName='$(NewSchool)' WHERE UsersID='$(UID)'

    I'm not sure why it's not working.  I have another DR module that is tied to be default user registration module and this SQL Completion Event works on that one, so I know the syntax is correct, but I'm unsure why it's not firing when there is registration update.  Any ideas?

    Thanks for your help.
    Jerry

    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-07-2009 12:39 PM

    Oh...I've found it...UsersID should be UserID...now that I've switched it...it's working! 

    Thanks candace and chad for all your help!

    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-08-2009 05:58 AM

    Okay..unfortnately I have one last issue with this project..(should I start a new thread?).

    So I have a IndooGridView module that lists the users, and passes the querystring parameters of UserName, DisplayName, FirstName, LastName, Email, SchoolAttending(added to DNN Profile), and GradeLevel(Added to DNN Profile), and UserID. to the DR Module on another page.

    The DR Module correctly sees these fields because the shortnames matches the querystring parameter sent and using Advanced Core Integration Options, I have hidden the fields I can. All the other controls are marked not to upload to database, as I have completion events to run SQL to update FirstName, LastName, Email, SchoolAttending, and GradeLevel, provided that a checkbox has been ticked for each field they want to update. This SQL updates the Users Table and the UserProfile Table.

    This all works correctly when I'm logged in as the host. I've created a role to assign specific users (so they can manage user profiles) and assigned it to the pages with the IndooGrid and the DR Modules. This role has view rights only.

    When I test a user account mapped to that role, the indoogrid does pass the parameters correctly and the DR does receive the parameters, but when I try to make a change to any of the fields, the DR module updates the Users and UserProfile Table of the logged in user.

    It looks like DR doesn't use the passed UserID but the logged in UserID, so when the SQL completion events are firing off they are using the wrong UserID.

    So what did I miss here? Will this not work?

    Thanks again for your help!
    Jerry

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-08-2009 06:43 AM

    HI Jerry, let me try and understand this. So any users belonging to the role can edit other user's profile that belong to that role also by picking the IndooGrid fields and sending them as querystring over to DR for SQL updates? If this is the case, you will need to use the SQL 'DSParam1' option for the UserID. Name the shortfield in IndooGrid for UserID to 'DSParam1' and pass this querystring. In your DR form, create a hidden field called 'DSParam1' that request value from querystring and then in your SQL update statement (check our form demo 14), use something like: where UserID = '$(DSParam1)'. -- David

    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-08-2009 09:52 AM

    Hi,

    The role I created can edit anyone's profile, however, I use the indoogrid to filter out those users that belong to the same school.(SchoolAttending Field) that the logged in user belongs to. So I have many schools a, b, c, d, and my user belongs to school a. The role gives the view rights to the page, but their profile filters out on the indoogrid to show them users in ther school only. For example, my user can only see user profiles that belong to school a.

    I've tried what you suggested and it appears to work better. Now it's actually updating the user profile I selected, but it's still changing my current user that is logged in as well. WHen before it was only changing the current user logged in.

    So I'm closer...It appears that fields mapped in the DNN core integration are overwriting my current user login info eventhough I've setup a SQL completion event to update my selected User Profile.

    Is there a way to get around this?

    Thanks for your help.
    Jerry

    UPDATE: I went to the DNN Integration and set the Recommended fields to select dynamic fields and that helped.  It's no longer overwriting my logged in user's FirstName, LastName, Email, and DisplayName.

    Despite the UserID being passed as DSParam1, it's still changing my logged in user profile information along with my selected user.  Here is the SQL completion event.

    UPDATE UserProfile
    SET PropertyValue='$(USA)' WHERE PropertyDefinitionID='59' and UserID='$(DSParam1)

    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-09-2009 07:15 AM
    HI Jerry, I don't know of an easy way to get around this. Problem is, when you click on "Update Registration" button, I believe it automatically acts on the current user logged in. The SQL completion event is in addition. I guess an option is to generate a duplicate table of the "UserProfile" table and then call on that copy to update the original "UserProfile" table with the current user logged in $(UserID). That way, you can reset the current logged user back to his previous profile by using the backup table data. However, this means you will need to generate a store procedure or script to keep both tables in synch after copying the data back. -- David
    David ToUser is Offline
    river guide
    river guide
    Posts:2719
    Avatar

    --
    04-09-2009 07:26 AM
    Now that I thought about it a little bit more, you can try creating a form completion SQL event that will copy the currently user logged in "UserProfile" data to a temp table, and then update the original "UserProfile" table with the temp table information and maybe this will overwrite the info on submit. I don't know if this will work but it might. -- David
    jeropsUser is Offline
    river guide
    river guide
    Posts:99
    Avatar

    --
    04-09-2009 12:47 PM

    Thanks for the idea...But I'm not sure it's going to work...as you said the Update Registration acts in conjunction with the SQL completion event...I guess it depends on wheter the SQL completion events fire after the Update Registration fires.

    If the Update Registration runs it's updates then the SQL Completions fires off, then this might work...it's worth testing.

    What's weird is that it doesn't happen when I'm logged in as a SuperUser...it only happens when I'm logged in as User that has View Permissions to this page.

    You are not authorized to post a reply.


     
     

    Join our mailing list...

    Get current news and events the easy way
    Subscribe Me

    Recent Blogs...

     
    Copyright 2005 - 2011 by Data Springs, Inc.
     
  • film izle
  • 720 izle
  • film
  • sinema izle
  • film makinesi
  • T�rk�e dublaj film
  • film izle
  • film izle
  • baglan film izle
  • sinema izle
  • 1080 film izle
  • film mercegi