CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: NewsGroup Date Entered: 1/9/2007 4:07:06 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 17 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
Classicsmiley
Asp.Net User
Help needed with SqlTableProfileProvider1/9/2007 4:07:06 AM

0/0

Hello, I'm using the SqlTableProfileProvider in a project of mine because I don't want/need to have all of my values serialized as binary in the database. However, I *do* have one Profile property that I would like to serialize (to store a custom datatype). I have not been able to find any examples of how to do this successfully. Can anyone help me out, please and thanks? -Joel
abonslater
Asp.Net User
Re: Help needed with SqlTableProfileProvider1/9/2007 10:12:30 PM

0/0

Hello,

 There are a couple of ways to create custom profile data types.

1.) To create a custom profile data type to store multiple string values, you first need to create a class that inherits from ProfileBase that defines your profile properties in the App_Code folder. The class should look like this:

using System;
using System.Collections;
using System.Collections.Generic;
using System.Web.Profile;

public class CustomProfileClass : ProfileBase
{
    public CustomProfileClass() {}

    public List<String> Models
    {
        get { return (List<String>)base["Models"]; }
        set { base["Models"] = value; }
    }
}
2.) To create any other custom profile data types that would like to your web.config. Notice the inherite attributes points to your custom profile class.
<profile enabled="true" defaultProvider="AspNetSqlProfileProvider" inherits="CustomProfileClass">
      <providers>
        <clear />
        <add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ASPNETMembershipDB" applicationName="/" />
      </providers>
      <properties>


        <add name="DisplayName" type="string" allowAnonymous="true" />
        <add name="ContactEmail" type="string" allowAnonymous="true" />

      </properties>
    </profile> 
You should now notice that the Profile object shows your custom data types in Intellisense. You can add values to the custom data types similar to:
Profile.DisplayName = this.txtDisplayName.Text;
Profile.ContactEmail = this.txtContactEmail.Text;
foreach (ListItem item in lbxModels.Items)
{
          if (item.Selected == true)
              Profile.Models.Add(item.Value);
}
Thanks,
Andrew

Check out my new blog at blog.sitelife.com/themaddblogger
Classicsmiley
Asp.Net User
Re: Help needed with SqlTableProfileProvider1/10/2007 4:39:44 AM

0/0

Andrew,

Thanks for the reply.  It looks like your example uses the standard AspNetSqlProfileProvider, though, and I am using the SqlTableProfileProvider (available here: http://www.asp.net/sandbox).  I'll take a look, though, and see if the same code will work.

 -Joel
 

RBrown
Asp.Net User
Re: Help needed with SqlTableProfileProvider3/20/2007 6:51:53 PM

0/0

The above code will not work with the SqlTableProfileProvider.  I can't even get the default provider to store Guids.

Somebody in the Sandbox crew neebs to produce a real White paper on the SqlTableProfileProvider rather than the one they have.  At least tell us what we can and cannot do with it, and what code that works in the default provider will not work in this.  Right now everything is a *** in the dark, almost renders it useless in my opinion.

 

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Example project needed - VWD, SQLtableprofileprovider, and custom ... Example project needed - VWD, SQLtableprofileprovider, ... Ok, if no one here has any help to offer, could anyone at least suggest another ...
Would too many SqlTableProfileProvider items impact performance ... Exactly what I needed, I figured there must be an attribute that goes on ... I also added a group tag to help identify which items go with ...
ASP.NET 2.0: Manage Web Users With Custom Profile Providers If the ProfileCommon isn't saved, there is no way for ASP.NET to know that a data write is needed. Figure 4 SqlTableProfileProvider Class ...
p2p.wrox.com Forums - How i can modify the User profle I thought this comment may prove helpful if creating new classes to add to this SqlTableProfileProvider. I hope all my mistakes will help others in this ...
cmd.ExecuteNonQuery question..help please - SQL Server - ExecuteNonQuery" and another file SqlTableProfileProvider for a SandBox ..... Add(new ProfileColumnData(columnName, value, null /* not needed for get */ ...
Overlapping of Report items in renderers(HTML and Excel) - SQL ... IsNullOrEmpty(name)) name = "SqlTableProfileProvider" ; if ( string . ..... Why is this needed for everyone Thanks in advance for your help in answering ...
Out of memory - August 2007 Config file is all that is needed to configure the website's profile system to allow the ... Basically the SqlTableProfileProvider allows you to map Profile ...
.NET ASP Page 32 - Bytes Site Map ... String · regular expression · Help needed in transfering VC++ program to WWW .... SQLTableProfileProvider · SQL Server EXPRESS and .MDF in Visual Studio ...
Writing a custom ASP.NET Profile class - Jon Galloway hei .... can anyone please help me ? I am trying to implement the custom profile ... To use this approach with the SqlTableProfileProvider(www.asp.net/. ...
microsoft.com - Microsoft .com - the rarest words from url. sqltableprofileprovider passi ugidotnet siverlight incluse ricevere ..... These sites will help you when you are into domaineering → domaineering.biz ...




Search This Site:










upload new containers and skins

install error (index was out of range) with 3.0.7 clean install.

cannot drop objectdatasource onto content page....help!

error converting data type nvarchar to datetime

ttt forum/gallery pack

which cms?

redirectfromloginpage will set e.authenticated = true?

weird 403-3 error

forms authentication problem

security issues?

new http alias?

how to turn off authentication on some pages?

adding web reference - files generated in vs 2005 and other questions

hack attempt

need to know how to set source code location

problem with codebehind functions

upgrade, next generation

dnn changing div tag id

3.1.1 installation issues

how do i stop a web part from caching its data?

databinding - performing operations on bound values

adding a property/attribute in custom control

not getting the updated control

support desk 2.5 won't install on dnn 2.1.2

vs2008 beta 2 has a huge memory leak

how to centralized content?

trouble installing club starter kit with release vs2005

how do i use the login with windows user logins?

dnn content builder

best practice aspnet_users database.

 
All Times Are GMT