.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Using the SQL Table Profile Provider in ASP.NET 4 Web Applications (C# & VB)

Posted By: Ken Cox [MVP]     Posted Date: September 06, 2010    Points: 0   Category :ASP.Net
This post and accompanying projects demonstrate how to use Microsoft's SQL Table Profile Provider with an ASP.NET Web application. ASP.NET's built-in Profile provider (SqlProfileProvider) stores Profile data in an oddball, serialized format that's hard to use in queries and may not scale well in large sites. To help developers use a more standard database format, Microsoft posted the source code for a sample provider (SqlTableProfileProvider). It stores each Profile property in a separate database...(read more)

View Complete Post

More Related Resource Links

Using the SQL Table Profile Provider in ASP.NET 4 Web Applications (C# & VB)

 Just an FYI for those trying to use the SqlTableProfileProvider in a Web application project. Here's my article: Using the SQL Table Profile Provider in ASP.NET 4 Web Applications (C# & VB) http://weblogs.asp.net/kencox/archive/2010/09/05/using-the-sql-table-profile-provider-in-asp-net-4-web-applications-c-amp-vb.aspx The complete projects are here: http://code.msdn.microsoft.com/aspnet4profile   Ken        

SQL Table Profile Provider



I use Miscrosoft SQL Table Profile Provider (http://code.msdn.microsoft.com/aspnet4profile/Release/ProjectReleases.aspx?ReleaseId=4922)

as custom profile provider because I need access user's properties from SQL queries. But

I notice that UserId in my customer profile table is different from UserId of aspnet_User table, so I can't join these tables.

How do I connect the properties to users?

Profile Provider in Asp.Net MVC

The article Profile Provider in Asp.Net MVC was added by krokonoster on Wednesday, June 02, 2010.

Finding very little information on how to implement Profiles in Asp.Net MVC, I thought I'd share my solution to implement this. For demonstration purposes, let's assume you want to store a user's First and Last Name only. Firstly I created

Programmatically Changing the Profile Provider at Runtime


Dear All

I'm using one application but have multiple providers in my web.config for memberships, roles and profiles to allow my application to be used by different groups of users who need to connect to different databases.

This means I'm having to change the membership, role and profile providers on-the-fly in my code-behind files. So far I've taken care of the membership and roles a bit like this:

Dim RolePV As RoleProvider = Roles.Providers(GetSettingFromFile("Provider"))

However, I'm having trouble finding out how to do the same sort of thing for Profiles. I've looked at ProfileProvider and ProfileManager but I can't work it out how to access my the profile property that I've created in my web.config file called "ScreenSize". Normally you would just write Profile.ScreenSize to read or write to the property.

Please can you help me to understand how I access the profile property called ScreenSize by dynamically setting the profile provider first?

I'd be very grateful for any help or advice.

Many thanks



Implementing a custom Membership Provider vs. using aspnet_Profile table - Which should I do?


I wanted to expand the amount of information that is associated with each user(MembershipUser) in the ASPNETDB.MDF database file. Adding columns like FirstName, LastName, etc. So I began implementing my own custom Membership Provider. I created a derived MembershipUser class with the extra private variables that I wanted each MembershipUser record to store. Its basically done. Almost after I did this I stumbled across the columns in the ASPNETDB.MDF->aspnet_Profile table called "PropertyNames" and "PropertyValuesString".  Could I have simply used these two columns to accomplish what I was attempting to do or are these columns for global application configuration settings?  

Is the aspnet_Profile table purpose to store expanded/related information about users such as personal information? Or is it for something else? Thanks.

FBA users (ldap provider) don't have any user profile info when logged in.... what am I doing wrong

Sharepoint 2010, Claims authentication, FBA using ldap membership provider and role provider against Active Directory.  User profiles all imported just fine -- used the LDAP FBA provider hitting Active Directory to do so too.  whenever an FBA user logs in, it doesn't seem like sharepoint is picking up any user attributes.  targeted audiences don't work and MY SETTINGS is blank other than account and name.  If the same user logs in but through Active Directory, everything works just fine... targeted audiences, etc. Am I doing something wrong or can I not use the LDAP provider to authenticate to AD and also use the user profiles from Sharepoint?  GRRRRR.  All this to get around the Windows Authentication popup so I can customize a better looking logon experience.  Help?

Profile Provider


Hi All,

I'm trying to implement on a MVC2 web application tha authentication. I successfully use standard Roles and Login through default Membership Provider, I can store usernames, passwords ,roles, assign roles to users etc. I'm not able to expand the user data. I need to save personal information such as address, phone numbers etc.

I try to implement a custom ProfileProvider following some tutorial online:

	public class UserProfile : ProfileBase
		#region Properties

		public string FirstName
			get { return base["FirstName"] as string; }
			set { base["FirstName"] = value; }

		public string SecondName
			get { return base["SecondName"] as string; }
			set { base["SecondName"] = value; }

		public string LastName
			get { return base["LastName"] as string; }
			set { base["LastName"] = value; }


		public static UserProfile GetUserProfile(string username)
			return Create(username) as UserProfile;

but I can't find a method to show the whole list of user. I saw that the ProfileProv

Setting Membership/Profile/Role provider's connection string at runtime...?


How can I set the connection string for the built-in membership, profile and role providers at runtime?

Since each site in our multi-site application uses a separate API to retrieve its specific connection string (via key, for security purposes), I cannot set the connection string to my providers in the web.config file. I need to be able to set the connection strings programmatically at runtime, but I cannot find how to implement this.

I thought many people must have run into this problem, but I can't seem to find anything regarding this.Can anyone here help me with this problem?



Custom Profile Provider and Role - Mysql


May I ask if how can I create a custom mysql profile provider with the following properties?

                <add name="ProjectID" type="Int" defaultValue="0"/>
                <add name="TeamID" type="Int" defaultValue="0"/>
                <add name="EmployeeID" type="String" serializeAs="String"/>
                <add name="LastName" type="String" serializeAs="String"/>
                <add name="FirstName" type="String" serializeAs="String"/>
                <add name="MiddleName" type="String" serializeAs="String"/>
                <add name="NickName" type="String" serializeAs="String"/>

Code Optimized Web Development Profile (VS 2010 and .NET 4.0 Series)

When you first run VS 2010 it prompts you to select an IDE profile to use. The profile you select will configure how tool windows are displayed/docked in the IDE by default and set the default keyboard shortcuts. You can then customize any of these settings by using the Tools->Options menu within the IDE and then override/change them. You can also later reset your profile and pick a different one by choosing the Tools->Import and Export Settings menu command.

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

ASP.NET Best Practices for High Performance Applications

This article lists the techniques that you can use to maximize the performance of your ASP.NET applications. It provides common issues, design guidelines, and coding tips to build optimal and robust solutions.

Insert value using Table Value Functions

a real gem in Sql Server 2008. mostly people still using Stored procedure may be they shifted to SQL Server but they are not using TVF right now.

Business Modelling and Web Applications and extending UML

UML can be used to model a business, prior to automating it with computers. The same basic UML syntax is used, however, a number of new symbols are added, in order to make the diagrams more relevant to the business process world. A commonly-used set of these symbols is available in current versions of Rational Rose.

Building Layered Web Applications with Microsoft ASP.NET 2.0 - Part 1

"Building Layered Web Applications" that shows you how to build N-Layer applications with Microsoft ASP.NET 2.0. These articles teach you how to design, build and use custom business objects in your web application. The target audience for this series are developers that are ready to make the switch from using SqlDataSource controls to ObjectDataSource controls with custom business objects. Experience with ASP.NET 2 and C# is necessary while some knowledge about object oriented design certainly helps. The design I am going to show you in these articles is a simplified version of a design you would use in a real world application. It doesn't feature all the necessary functionality your application needs, but instead focuses on the underlying concepts.

How to improve the performance of ASP.NET MVC web applications

It is an in depth analysis of a Digg-like site and how it went from serving (on a test machine) 6 req/sec to 390 req/sec.

The biggest gain, 74 req/sec to 390 req/sec happened when he introduced data caching and another 25 req/sec where gained when he introduced the compilation of LINQ queries.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend