I'm writting a simple t4 template to create scripts for my SQL Server 2008 database. This lines of code:
1 myDataBase.Refresh();
2 var tableName = "sometable";
3 Table t = myDataBase.Tables[tableName];
are resulting in t == null
. The "sometable" is in my database and is not mispelled, the connection works fine. Debbuging the template and returning the execution point to the line 3 populates the t
variable correctly. Someone can help me to undestand what's happening?