Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Retrieve UserID or UserName variableRetrieve UserID or UserName variable
Previous
 
Next
New Post
5/7/2009 5:22 PM
 

We are new to DNN and are doing a site with 4.9. We need to be able to filter a grid or report based on the UserName the person logs in with. UserID is also fine, as we can join a couple tables on UserName and get the same result.

As hard as we are searching, we can't find or figure this out. It must be simple, no?

We set a connect string and put a SQL statement in (select * from MyTable) and it returns everything fine. What do I need to do to get select * from MyTable where username = <dnn user name> working properly? What is the variable name? How do we retrieve it?

 

Thank you.

 
New Post
5/7/2009 6:40 PM
 

Hi, Mike-
Though this may not be what you'll want for your long-term solution, one easy way to get started with DB access and queries based on common DNN values without creating your own custom modules is outlined in several simple examples here:

   Free module:  Advanced DataGrid (Part 1) -- Make a "Most Recent User Signups" List
   http://www.eguanasolutions.com/DNN_Blog/EntryID/2.aspx

   Free module:  Advanced DataGrid (Part 2) -- Make an "Events Status" Table for the EVENTS Module
   http://www.eguanasolutions.com/DNN_Blog/EntryID/5.aspx

   Free module:  Advanced DataGrid (Part 3) -- Create a Clickable "Most-Commented" Blogs Module
   http://www.eguanasolutions.com/DNN_Blog/EntryID/13.aspx

   Free module:  SQLView -- Make an EVENTS List Sortable by City / County / State
   http://www.eguanasolutions.com/DNN_Blog/EntryID/15.aspx


Note that at least one person has reported having trouble with Advanced Datagrid under DNN 4.9.x so you might prefer SQLView (SQLView has more features, anyway).  Both modules offer a few "tokens" you can use in your query to represent the logged in user's UserID, PortalID, etc.  Here's a recent post with an example of using Advanced Datagrid tokens for UserID and PortalID:
 
   http://www.dotnetnuke.com/Community/Forums/tabid/795/forumid/108/threadid/305817/scope/posts/Default.aspx


Also note:  The DNN REPORTS module is another free offering (and is a "core" module) that may provide the functionality you need.
 
Cheers!
-mamlin

 


esmamlin atxgeek.me
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Retrieve UserID or UserName variableRetrieve UserID or UserName variable


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out