Profile data is being stored as blobs, can't retrieve

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Profile data is being stored as blobs, can't retrieve

Post by brown » Sun 15 Oct 2006 13:32

String data is being saved as blobs in aspnet_profiles propertyvaluesstring column. Is this wrong?

Problem is that i can't retrieve profile values.

How should fields be coded in web.config?

Tried:




and also tried:




aspx code:


aspx.cs code to save:
protected void SubmitButton_Click(object sender, EventArgs e)
{
Profile.FirstName = FirstNameTextBox.Text;
// this saves data as blob
}

aspx.cs code to get:
protected void Page_Load(object sender, EventArgs e)
{
if ( !IsPostBack )
{
FirstNameTextBox.Text = Profile.FirstName;
// returns empty string
}
}

also, please provide an example line that shows how to code other data types, for example int, in the profile properties. Is it -

or

or?

thanks

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Mon 16 Oct 2006 07:36

How should fields be coded in web.config?
Web.config file section should look like this:

Code: Select all

    
      
        
      
      
        
        
      
    
FirstNameTextBox.Text = Profile.FirstName;
// returns empty string
What version of MySQLDirect do you use? Try to use the latest one from our site.

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Mon 16 Oct 2006 17:09

The history.html file says 3.50.13 19.09.06, not sure where else to check for version. The code on the web.config is identical to your post.

This was on a PC using Visual Web Developer.

Have since moved to a box using Visual Studio 2005 Professional and we are using Web Application Projects. In this project it requires
type="CoreLab.MySql.Web.Providers.MySqlProfileProvider, CoreLab.MySql.Web, Version=3.50.13.0, Culture=neutral, PublicKeyToken=09af7300eec23701"
instead of
type="CoreLab.MySql.Web.Providers.MySqlProfileProvider"
otherwise when run it gives error: Could not load type 'CoreLab.MySql.Web.Providers.MySqlMembershipProvider'

Also in this project the Profile class object is not recognized in the .cs file at all.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 17 Oct 2006 06:38

In this project it requires type="CoreLab.MySql.Web.Providers.MySqlProfileProvider, CoreLab.MySql.Web, Version=3.50.13.0, Culture=neutral, PublicKeyToken=09af7300eec23701" instead of type="CoreLab.MySql.Web.Providers.MySqlProfileProvider"
otherwise when run it gives error: Could not load type 'CoreLab.MySql.Web.Providers.MySqlMembershipProvider'
If you refer to MySqlProfileProvider, why VS swears about MySqlMembershipProvider? Please clarify.
Also in this project the Profile class object is not recognized in the .cs file at all.
What do you mean? VS gives you compile error?

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Tue 17 Oct 2006 10:14

To clarify, I have 2 problems at this point.

1 - As stated in my original post, on my first project, String data is being saved as blobs in aspnet_profiles propertyvaluesstring column. Problem is that i can't retrieve profile values. Looks like I have the newest CoreLab software - 3.50.13. Why can't I retrieve profile values?

2 - In the 2nd project, using Visual Studio 2005 Professional and Web Application Projects, I can't use the Profile object in the .cs file. This code:
protected void SubmitButton_Click(object sender, EventArgs e)
{
Profile.FirstName = FirstNameTextBox.Text;
// this saves data as blob
}
gives this compile error: The name 'Profile' does not exist in the current context. Any ideas? Is there something more needed with Web Application Projects?

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 17 Oct 2006 11:50

Looks like I have the newest CoreLab software - 3.50.13. Why can't I retrieve profile values?
I've sent you CoreLab.MySql.Web.dll. This bug is fixed in it.
I can't use the Profile object in the .cs file.
If you create ASP.NET Web Site project Profile property should be recognized by compiler. What version of Visual Studio do you use?

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Tue 17 Oct 2006 14:51

OK, I have spent the last hour trying to add the DLL to the GAC. Can't find the gacutil. But it doesn't matter unless my 2nd issue can be resolved.

2nd issue:
I am using Visual Studio 2005 Professional Edition - version 8.0.50727.42

But we are not using an ASP.NET Web Site project, we are using an ASP.NET Web Application Project. This is an ASP.NET 2.0 project, which uses a similar project model as .net 1.1.

See http://msdn.microsoft.com/vstudio/defau ... ml/WAP.asp

In this project, the membership stuff works fine, but the Profile object is not available. See previously mentioned error message. Am I doing something wrong? Or has CoreLab tested profiles with this project type?

We are evaluating the software and need to know the situation.

thanks

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Tue 17 Oct 2006 17:28

I did successfully add the new DLL to the GAC and this fixed the first issue. Still need to resolve the 2nd issue to proceed.

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Wed 18 Oct 2006 08:47

Web application project is an alternative project type. It provides the same Web project semantics as Visual Studio .NET 2003 Web projects. If VS doesn't recognize "Profile", then it is not supported in this project type. For more information please refer to Microsoft help documentation.

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Wed 18 Oct 2006 15:07

Found the problem.

With the VS 2005 Web Site Project option, Visual Studio dynamically creates and adds a "ProfileCommon" class named "Profile" into every code-behind instance.

VS 2005 Web Application Projects don't automatically support generating a strongly-typed Profile class proxy. However, you can use the following free download to automatically keep your own proxy class in sync with the profile configuration.

http://www.gotdotnet.com/workspaces/wor ... f135df4127

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Fri 20 Oct 2006 13:02

Thanks for your consideration.

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Mon 23 Oct 2006 14:49

After testing this more and using the newest CoreLab.MySql.Web.dll sent to me, I've realized it doesn't always work.

When the profile data is added, there is a new aspnet_users record created which doesn't have a matching userid as the existing aspnet_users and aspnet_membership records for this user. A aspnet_profiles record is added with a userid that matches the newly created aspnet_users record and doesn't match the existing aspnet_users record.

This seems wrong, and I'm surprised profile data is ever able to be retrieved. Sometimes it can't be.

When a aspnet_profiles record is added, it's userid should match the existing aspnet_users record and no new aspnet_users records should be created.

This is happening with Visual Web Developer and Visual Studio 2005 Professional.

My code is basically like this:
protected void Page_Load(object sender, EventArgs e)
{
if ( !IsPostBack )
{
FirstNameTextBox.Text = Profile.FirstName;
}
}
protected void SubmitButton_Click(object sender, EventArgs e)
{
Profile.FirstName = FirstNameTextBox.Text;
}

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Tue 24 Oct 2006 06:21

Could you please send a test project to me?

brown
Posts: 11
Joined: Sun 15 Oct 2006 12:56

Post by brown » Wed 25 Oct 2006 17:06

Found my problem.

First I added the ApplicationName="/" attribute to the providers section for membership and profiles in the web.config. I tried applicationName previously which gave me an error.

The other problem was related to how I was using the .net framework add-in mentioned earlier in this thread for Web Application Projects.

thanks

Alexey
Posts: 2756
Joined: Mon 13 Mar 2006 07:43

Post by Alexey » Thu 26 Oct 2006 06:05

So you resolved the problem by yourself?

Post Reply