Introduction:
Using ASP.Net 2005 login controls saves time and effort and produces a professional user management on your ASP.NET web site. User Profile is responsible for extending user properties; but there was a problem faced me that searching is not supported in user profile properties. If you want to search in profile properties you should customize profile provider or complete reading this article.
Profile Information Storage:
Default Profile Provider usually stores profile data in aspnet_Profile table in the following format:
PropertyNames: FullName:S:0:4:City:S:4:7:NickName:S:11:8:Mobile:S:19:4:
PropertyValuesString: AmroCairoooAmrooooo1212
As you can notice the PropertyNames describes PropertyValuesString for Example: FullName:S:0:4: means that the FullName Property which is String starts at index 0 and has length of 4. If you apply that you will get FullName = Amro From that principle I worked to generate a view that displays profile properties each as a column and thus we can search in that view.
Workout Summary:
-
Configure Default Profile in web.config.
-
Generate Assembly for SQL Server 2005 that gets start and length of each profile property.
-
Create the view using generated Assembly.
Default Profile Configuration:
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type= "System.Web.Profile.SqlProfileProvider"connectionStringName="ConStr"/>
</providers>
<properties>
<add name="NickName"/>
<add name="City"/>
<add name="Mobile"/>
<add name="FullName"/>
</properties>
</profile>
Generate SQLSERVER Add-on:



Join the conversation! Your thoughts help the community grow.