I have a situation that I can't figure out. Say I have tableMain, and tableSub. Say I have an association in the dbml between tableMain and tableSub such that tableMain is the parent class and tableSub is the child class. I can't insert any records programmatically into tableSub. I get a "Specified cast is not valid." error. If I remove the association and run the exact same code, the record is inserted without a problem.This has been an issue for me for some time. I've resorted to haveing a second dbml to use when inserting records into tables with an association with my main table, but I don't like having tables in more than one dbml unless it's really necessary. It's too easy to forget to update a dbml when changing a table structure.Does anyone know why this is happening?
View Complete Post