Maintenenanced Form- Add buttom giving InvalidCastException


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
I have a standard maintenance form, and am able to browse through the records no problem. However, when I try to add a record , I get an Invalid Cate Exception in code below. I have changed some fields recently on the database, but my Primary Key is SMA_PK which is set up as an INT field in the table.. this is what seems to be causing the error. I suspect I have not changed something somewhere ....

/// <summary>

/// SMA_PK

/// </summary>

[Browsable(false),

BusinessFieldDisplayInEditor(),

Description("SMA_PK"),

DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

public System.Int32 SMA_PK

{

get

{

return (System.Int32)this.CurrentRow["SMA_PK"];

}

set

{

this.CurrentRow["SMA_PK"] = value;

}

}


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search