B
BigDave
Hi all, I tried this question in the WinForms forum, but perhaps I'll
have better luck here.
We have an ASP.NET 2.0 web app which uses Profiles, and want to write a
little WinForms app to administer sections of the site.
In a little prototype, I was able to utilize Profile in the WinForms
app! I added this to my app.config:
<system.web>
<profile>
<properties>
<add name="FirstName" type="string" />
<add name="LastName" type="string" />
</properties>
</profile>
</system.web>
(So, it's using the default SQLExpress database/provider).
I then wrote this code in a form to create and save profile info:
Dim p As ProfileBase = ProfileBase.Create(txtUsername.Text)
p("FirstName") = txtFName.Text
p("LastName") = txtLName.Text
p.Save()
NOW, I do have one remaining question. When using Profile in ASP.NET,
ASP.NET somehow creates a "ProfileCommon" subclass of ProfileBase with
strongly-typed properties (as opposed to the non-strongly-typed
properties that I use above). Each Page's "Profile" property returns
this ProfileCommon.
How does ASP.NET create this ProfileCommon class - does it
code-generate it? Secondly, is there a way that I could make use of
the strongly-typed ProfileCommon class in my WinForms app?
Thanks!
have better luck here.
We have an ASP.NET 2.0 web app which uses Profiles, and want to write a
little WinForms app to administer sections of the site.
In a little prototype, I was able to utilize Profile in the WinForms
app! I added this to my app.config:
<system.web>
<profile>
<properties>
<add name="FirstName" type="string" />
<add name="LastName" type="string" />
</properties>
</profile>
</system.web>
(So, it's using the default SQLExpress database/provider).
I then wrote this code in a form to create and save profile info:
Dim p As ProfileBase = ProfileBase.Create(txtUsername.Text)
p("FirstName") = txtFName.Text
p("LastName") = txtLName.Text
p.Save()
NOW, I do have one remaining question. When using Profile in ASP.NET,
ASP.NET somehow creates a "ProfileCommon" subclass of ProfileBase with
strongly-typed properties (as opposed to the non-strongly-typed
properties that I use above). Each Page's "Profile" property returns
this ProfileCommon.
How does ASP.NET create this ProfileCommon class - does it
code-generate it? Secondly, is there a way that I could make use of
the strongly-typed ProfileCommon class in my WinForms app?
Thanks!