none
Workaround for Columns Named 'PropertyChanged'? RRS feed

  • Question

  • Hi,

    I'm using SQLMetal to generate a code file for a legacy database.  It all looks good except I have 2 tables that have columns actually named PropertyChanged.  This collides with the event declaration with the same name and the code will not compile.  What's the best way to work around this problem?  Thanks!

    - Erik
    Erik Johnson
    Wednesday, January 21, 2009 10:57 AM

All replies

  • Just give the properties a different name in the designer. Property names can be different than the underlying column names*.

    * = with one exception: if the value is auto-generated in the database, e.g. default set to newid(), newSequentialID(), GetDate() or similar and you mark the column as auto-generated then the property name and column name must be the same. Unusual border case though.
    Wednesday, January 21, 2009 11:40 AM
    Answerer