Question on Tutorial


Author
Message
Bo Harris
Bo Harris
StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)StrataFrame Beginner (5 reputation)
Group: Forum Members
Posts: 5, Visits: 16
Working through the tutorial and got the CustomerMaintenance form up and running. However when I click on "New" an InvalidCastException is thrown.



Exception message states "Unable to cast object of type 'System.DBNull' to type 'System.String'." Offending line of code is in the 'get' accessor for the CustomerID field and reads - "[font=Courier New]return (System.String)this.CurrentRow["CustomerID"];[/font]".



I know I can put in some code in the get accessor to check for DbNull but was just wondering if there is a property or something that can be set to true so that the generated code will automatically account for null scenarios.
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