Retrieve user login details and respective user profile in one datatable to show in grid

Hi

i would like to retrieve all my membership account and there profile details in one datatable or to one dataset so that i can

show them in grid.

following is what i tried

protected MembershipUserCollection msc;
protected ProfileInfoCollection upc;

msc = Membership.GetAllUsers();
UserGrid.DataSource = msc;
UserGrid.DataBind();
upc = ProfileManager.GetAllProfiles(ProfileAuthenticationOption.Authenticated);

The difficulty i am having is join these collections into one datatable.

in the above code i show all my user details but would like to show there respective profile details too

Thanks in advance

Gautam
 

0
Gautam
10/16/2006 3:10:09 PM
asp.net.security 27051 articles. 1 followers. Follow

2 Replies
968 Views

Similar Articles

[PageSpeed] 49

I built a tool (free) that lets you create an objectdatasource out of all your profile and membership data.  you cut and paste from your web.config and code generates (c# only, sorry) the full ODS.  this might help you.  saves me a huge amount of coding when I need to do this.  Of course you can modify the code to do anything you want.

http://painfreeods.peterkellner.net/

 

I also wrote a bunch of MSDN articles about this.  (OK, maybe 2 isn't a bunch)

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnaspp/html/ASP2memroleman.asp 

 

 


Peter Kellner
http://73rdstreet.com and blogging at
http://PeterKellner.net
MVP, ASP.NET
0
pkellner
10/16/2006 11:57:25 PM

Thank you looks perfect.

I just wanted to ask couple of question

1. It shows that all my contacts are online which is untrue.

2.When i try to edit i get following error

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

3.Can i have permission set to show delete command only when the user logged in has admin permission

 

 

0
Gautam
10/17/2006 4:18:39 PM
Reply:

Similar Artilces:

Multiple item selectd by one user but display user details only once in grid
Hi I have a table which contain Userdetails and item details in which an item purchased by any user. I have to display userdetails and the itemdetails, purchased by a particular user.One user may have to purchase many items.But user details shows ony once in grid and the details of all items puchased by the user must be displayed in grid.Please give me a solution for this Thanks and regards JinsoThanks & RegardsJinsoPlease mark as answer if this helped you.... Here's a very simple example utilizing a DetailsView and a GridView: <%@ Page Title="" Lang...

Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)
Hi when i try and open a database in sql server management studio i get the error "Cannot open user default database. Login failed. Login failed for user 'DOMAIN\User'. (.Net SqlClient Data Provider)", what can i do to rectify this, i have googled around and still havent found no answers. Which authentication mode is your Sql Server configured - MixedMode, Windows Authentication or Sql Server Authentication? Please refer to http://msdn2.microsoft.com/en-us/library/ms366351.aspx and http://blogs.msdn.com/sql_protocols/archive/2006/02/21/536201.aspx    Ple...

Retrieving User profile values for all users.
Hi, I had a search but could not find the answer to this question.  I am wanting to be able to retrieve all the individual profile values for every user and then show their first and last name in a drop down list so that I can select the name (value will be username).  I thought of gathering all the usernames in a datareader, then looping through each username and add the user profiles to a dataset, but how do I get the user profile values? I have found how to get the profile values for individual users when they have logged in using the ProfileBase =  HttpContext.Current.Pr...

Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection
This is my first time to deploy an asp.net2 web site. Everything is working fine on my local computer but when i published the web site on a remote computer i get the error "Failed to generate a user instance of SQL Server due to failure in retrieving the user's local application data path. Please make sure the user has a local user profile on the computer. The connection will be closed" (only in pages that try to access the database) Help pleaseee Hi You could take a look at this : http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=152338&SiteID=1Sincerely,Young Fang Hi ...

want to call one c#.net function in one user control from another user control
hi i have two user controls info.ascx and personal.ascx i have a function like in info.ascx i have a function like showdetails() {   } now i want to access this function from personal.ascx can i do this ? thanks in advance. shwetaThanksshwetaIn a day when don't come across any problem -you can be sure that you are traveling in wrong path  you should better create a class where you will define the "functions" that you need in both files. declare "static" the function and call it like nameofclass.nameoffunction In a web project you can...

How to bind grid of one user control from another user control
i am having a data grid in one user control say A and there is another user control say B when ever i add some vale in B that is inserted in to database and i want to call A's bind method of grid ... Please help me Nilesh Garg Well, If you can get a hold on Page control of user control then you can easily deal with the othe ruser control. Try something like this Me.Parent or Me.Page or somethinglike this to take hold on Page control and then you can easilly get instance of othe ruser control. Alternatively you can have one shared method somewhere in some class. Call it and i...

Single Users Profile and All Users Profiles List
I've made a discussion forum. And I have also installed simply asp.net membership. Now I want after click on user link to redirect to the page with User's info.I have simply user "John" and user "Bob" and everyone can click on those names and will see page with informations stored in Profile (Like Profile.Name, Profile.Address). I have three simply question:1. How to show profile values of other User ? Like I wrote above.2. How to list all users with for example their e-mails ? I mean: UserLogin - UserName - UserMail3. Or the easier way is to make new table with those all information an...

Retrieving user detail from DB after login
G'day, I have a "MyProfile" page in my project. This page displays user's information detail (such as name, address, phone, etc). To access this page, user must login first. I've got the authentication working. But the problem is how to display information detail of that particular user, from the database's User table after they successfully login. So far what I can only display in the "MyProfile" page is the user name , using label. Label1.Text=User.Identity.Name Please help me... Thanks~ Just write a stored procedure that takes the user ID as an...

How update or modify all users profile properties in one authenticated user!
How update or modify all users profile properties in one authenticated user!   Are you looking for a way to load the profile data for a user based on just their username, and then save the updated data back to the database?  If so you use code like: ProfileCommon p = Profile.GetProfile("some user name here");p.SomePropertyValue = "new value";p.Save();-Stefan----------------------------------------------------------This posting is provided "AS IS" with no warranties, and confers no rights....

How can I get the user login ID by user Profile.FullName
I have a multiple user fullname list in a page(the fullname is stored in Profile). I need to save the user LoginID into the database when I select the user fullname.How can I get the user login ID by user Profile.FullName?Thanks. I get the answer: 1.get all user 2. create profile3. get the fullname to compare and get the IDCheers*  Hi,As per my understanding you have Key = Value pair where Key =  FullName and Value=LoginID. What i would suggest that you store this key value pair in Profile using HttpContext.Current.Profile.SetPropertyValue(FULLNAME,LOGINID); [Put it once in...

Login Control logs user in, but User is not authenticated, but user really is!
I am using aspnetmembershipprovider.  Everything works fine.  I slap a login control on my login page and am able to login and get to my secure folder etc.  When I try and put some code in the LoggedIn method "User.Identity.IsAuthenticated" = false, yet if I blow through that, I am logged, authenicated etc.  The documentation says that the LoggedIn event is "after the user is authenticated".  Any Ideas what is up?Thanks,TPS------------------------------------------------------Note Collaboration for your next confernce call.http://www.ConferenceCallNotes.com I am...

Retrieving the new user ID after details have been created with Create New User Wizard
I've got a 'create new user' wizard set up with several additional wizard pages containing extra information. This information will be stored into the database when the CreatedUser event fires. However, I need to obtain the user ID of the newly created user. How can this be achieved? Assuming the user id is an Identity field that is generated in SQL, I would return the user id as an output parameter in your stored procedure and reference that parameter in your ASP.NET code.   I believe the code to get the identity value of a newly added record is: SELECT @myoutputp...

Multiple type of Users, with Multiple User login pages in one web application
Hello Friends, I have a situation in my website.I am using form authentication in my web application where I have two type of usersMerchants & Customers Merchants sign in from url/msignin/default.aspx and after sign in it redirects to secure folder /merchants/welcome.aspx and Customers sign in from/csignin/default.aspx and after sign in it redirects to secure folder /customers/welcome.aspx Now I am confused on the point that I only have one login url in my web.config file and only one default url. How can i make these two situations work on my same application. Please help. ...

DLU, "user management", user login and user source
I see I can disable the ZCM user login as discussed in the following documentation: 'Novell Documentation' (http://www.novell.com/documentation/zcm10/zcm10_system_admin/?page=/documentation/zcm10/zcm10_system_admin/data/bebfrq5.html) If I choose to disable the "user management" on the Agent, does that do the same thing? With User Management disabled, what else does that prevent? I am not assigning ANY bundles or policies to users - only to workstations. I do have a dynamic local user (dlu) policy assigned to workstations so I must have "User Source&quo...

Web resources about - Retrieve user login details and respective user profile in one datatable to show in grid - asp.net.security

Cowmen and Birdmen Win At Their Respective Sports
Australians rejoice! The Cowmen and the Birdmen have triumphed spectacularly at their respective sports, bringing home the trophies they have ...

Amazon, Barnes & Noble Pushing Updates To Their Respective Tablets That Break Root Access
Amazon started pushing an update to the Kindle Fire yesterday, and two words that no Android geek wants to hear were muttered shortly after: ...

Clinton, Trump speakers at respective party dinners in Arkansas
PALM SPRINGS, Calif. – Arkansas Republicans get a crude if quite rich buffoon with no chance for his party’s bid, let alone the White House. ...

Circumstances of respective nominations portend deeper White House, national security team links
President Obama rounded out his national security team on Monday, nominating former senator Chuck Hagel to head the Department of Defense and ...

Keller @ Large: Moulton, Tisei Attempt To Create Distance From Respective Parties
Seth Moulton and Richard Tisei, candidates for the 6th Congressional District, went toe to toe in a discussion with WBZ-TV's Jon Keller.

Ex-NFL Star, Businessman Form Friendship After Teens Ransack Respective Homes
A former NFL player and a businessman have formed a friendship after teens ransacked their respective homes last year. News, Sports, Weather, ...

Beltway World Series? Nats, O’s First to Clinch Respective Divisions
The Baltimore-Washington corridor is experiencing a golden age of baseball, with both the Nationals and Orioles clinching their respective divisions ...

U.S. Representatives Israel and Grayson explain their respective opinions on the U.S. waging war in Syria ...
As the world readies for Barack Obama 's upcoming nationally televised speech – an address expected to urge Congress to support a plan for military ...

The Four Types of Customer Connection and Respective Engagement Levels
How to connect with customers View more presentations from Valeria Maltoni Marketers are still working their way to understanding the customer ...

Bollig, Leddy ready to move past respective benchings
Brandon Bollig and Nick Leddy are both ready to move on and improve their game after receiving their respective benchings in Game 2 between the ...

Resources last updated: 1/1/2016 8:53:00 AM