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

HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Simple SQL too difficultSimple SQL too difficult
Previous
 
Next
New Post
12/31/2008 5:26 AM
 

I hope someone can help me here. I am developing a Web Service that selects information from the DNN Database and sends it to a desktop application as a DataSet. Let me keep it simple. I Send the Web Service a Portal Number and it must return ALL Users in THAT Portal along with their RoleNames and Role ID's Comaa Delimited as well as their Email, Telephone and Cell Number. I would ideally like to do this in ONE SQL Statement so if anyone can help, I would really appreciate it. I am confused and have tried for a few days so please, please, ANY help would VERY helpful.

 
New Post
12/31/2008 6:07 AM
 

Hi Failsafe,

I think you might be interested to search on IWeb of Michael Washington (adefwebserver?) and in a last software conference I saw a reading (but did not attend) about users in MS Outlook contacts..also using webservices.

Not really answer to your question, but maybe you can see some ideas in their code.

J.

 
New Post
12/31/2008 11:25 AM
 

The problem with the simple SQL statement you mention is that it is everything but simple :D

If what you want is to return a resultset containing the user information you mention AND the roles as a single, comma delimited field I dont think that you cant get away with it without using a SQL cursor. You can check http://www.sql-server-helper.com/tips/comma-delimited-output.aspx to get some more information in how you can setup your query to return the roles as commad delimited. Once you have this part done, retrieving profile information is a piece of cake.

Another way would be to exploit dnns to do the dirty job for you. You could for instance, invoke the GetUsers function to retrieve the collection of users as UserInfo classes, where one of its propertys is precisely the Profile. The same UserInfo class contains a collection of roles for that User in the Roles property, which you can also sweep to assemble the list as a single comma delimited string. Once you have all this you can assemble your own data table which you can return in your webservice.

The only problem with the latter approach is that you would make several calls to the db for each user... which can affect performance a bit. If youre not planning to use the webservice too often it shouldnt be a problem.

Cheers,

 
New Post
12/31/2008 11:55 PM
 

You want to achieve something that I have done in the past.  For example, I had to create an order feed that would send order data via a web service.  Each order could have more than one UPS tracking number, so I return 2 result sets from the database; the first result set has the order data in it and the 2nd has the order number and tracking number in it.  So for you, return 1 result set that has the users and another that has the UserId and RoleName for each user you returned in your last query (same WHERE clause).  Then just use some programming to tie to 2 result sets together.  Hope this helps.

 
New Post
1/2/2009 5:20 PM
 

I implemented similar to what Bryan describes. This query you put in a dataset and then the dataset goes into a webservice you can call. If you want to avoid that data has been changed during the separate sql calls, you need to define a temp table in which you for instance collect first the users, then you do a select on users, then a select on roles. In this way the complete dataset is filled.

I would recommend not to us the properties of DNN since you get very nastly and slow queries to get the data out.

J.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...DNN Platform (o...DNN Platform (o...Simple SQL too difficultSimple SQL too difficult


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