Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
| Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old August 18th, 2006, 04:23 AM
Authorized User
 
Join Date: Aug 2006
Location: Mostar, HNK, Bosnia and Herzegovina.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hcusto
Default Accessing users profile values question?

Hi,
I am using asp.net membership provider, I have a Country profile field, and now I need to access it for all users (To see which users belongs to specified country).

How can i do that?

Thanx in advance,
Haris

  #2 (permalink)  
Old August 18th, 2006, 04:59 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Haris,

The ProfileProvider class has a GetAllProfiles method. As it name suggests, it returns all the available profiles.

Then you can loop through the results and look at each individual profile.

This is not very efficient, but currently you're pretty much limited to this, because of the awkward format that the data is stored in. This makes it pretty hard to write custom methods that query the aspnet_Profiles table.

You can take a look at the Table Profile Provider for a replacement of the current provider, making it easier to fire custom queries: http://www.asp.net/sandbox/samp_prof...ndex=0&tabid=1

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
While typing this post, I was listening to: Digital by Joy Division (Track 1 from the album: Heart And Soul (CD 1)) What's This?
  #3 (permalink)  
Old August 19th, 2006, 03:23 AM
Authorized User
 
Join Date: Aug 2006
Location: Mostar, HNK, Bosnia and Herzegovina.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to hcusto
Default

Thnks Imar,
I will read it for sure.



Similar Threads
Thread Thread Starter Forum Replies Last Post
Prevent users from accessing the database window JAdkins Access VBA 1 February 2nd, 2008 03:10 PM
question about profile and global.asax hertendreef ASP.NET 2.0 Professional 0 January 24th, 2007 07:05 AM
accessing table values in VB pettrer ASP.NET 2.0 Basics 1 April 22nd, 2006 09:58 AM
Accessing values from the last sibling node graywoodhouse XSLT 3 October 29th, 2004 06:15 AM
Question about active directory users apalmero Access VBA 0 November 4th, 2003 03:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.