Zdravim , uz viac ako tri roky bez problemov frcim na výborných Altairis Simple Web Providers. Vcera som potreboval pridat dalsie polozky do profiles a pracovat s nimi. Takze som v tabulke Profiles pridal polozky Kraj, KrajS. Zatial vsetko fungovalo. V okamziku ked som pridal do web.configu
<profile enabled="true" automaticSaveEnabled="false" defaultProvider="MyProfileProvider">
<providers>
<clear />
<add name="MyProfileProvider" type="Altairis.Web.Security.SimpleSqlProfileProvider, Altairis.Web.Security" connectionStringName="PersonalConnectionString" tableName="Profiles" keyColumnName="UserName" lastUpdateColumnName="LastUpdate" />
</providers>
<properties>
<add name="FullName" type="String" defaultValue="[null]" customProviderData="FullName;varchar;50" />
<add name="BirthDate" type="DateTime" defaultValue="01.01.1900" customProviderData="BirthDate;smalldatetime" />
<add name="PageSize" type="Int32" defaultValue="10" customProviderData="PageSize;int" />
<add name="OrgJednotka" type="String" defaultValue="[null]" customProviderData="OrgJednotka;varchar;30" />
<add name="Kraj" type="Int32" customProviderData="Kraj;int" />
<add name="KrajS" type="String" defaultValue="[null]" customProviderData="KrajS;varchar;50" />
</properties>
</profile>
Sú to tie dve posledne polozky Kraj a KrajS tak stranka pri vytvarani usera vyhodi chybu
Server Error in '/EvidOdbornosti4' Application.
Input string was not in a correct format.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.FormatException: Input string was not in a correct format.
Source Error:
Line 46: public virtual string FullName {
Line 47: get {
Line 48: return ((string)(this.GetPropertyValue("FullName")));
Line 49: }
Line 50: set {
Source File: c:\Users\klanduch3007879\AppData\Local\Temp\Temporary ASP.NET Files\evidodbornosti4\3ce4d611\ba8b89cd\App_Code.mbz79mew.6.cs Line: 48
Pre info posielam aj kod ktorý volám pri stlaceni tlacitka vytvorit ucet
protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
{
string userName = CreateUserWizard1.UserName;
ProfileCommon p = ProfileCommon.Create(userName) as ProfileCommon;
//set params
p.FullName = "Meno";
// insert data
p.Save();
}
V podstate len vytvori zaznam v tabulke Profiles a do stlpca FullName prida text "Meno" Akonáhle z webconfigu odoberiem oba riadky
<add name="Kraj" type="Int32" customProviderData="Kraj;int" />
<add name="KrajS" type="String" defaultValue="[null]" customProviderData="KrajS;varchar;50" />
vsetko zas normalne funguje Neviem si s tým od vcera poradit aj som prezrel vsetky fora ohladne toho a nepomohlo.
|