tags:

views:

21

answers:

1

I have data access object that have been generated by SqlMetal, however the database is created by running a sql script.

Is there an easy way to verify that all table and columns names and type matches the attributes on the classes that SqlMetal created?

+2  A: 

I guess the easiest way to do this would be to have some kind of version number hidden in a config table in your schema. Then on runtime check the version number returned.

Much easier than doing a full scan. Set the version number in your SQL script and somewhere in your data access object

CResults
This is what I was writing... With the slight difference that I usually use an extended property of the DB to store the schema version.
Timores
Given that Link-to-sql can create the database tables it's self from the classes and mapping attributes, I was hoping that Link-to-sql could check that the mapping and database were compactable with each other.
Ian Ringrose
I left LINQ2SQL and went to PLINQO for this reason.
CResults