Creating an SQL Compact file: Template or script?
I am writing an application that writes to SQL Compact files that have a specific schema, and I am now implementing the New File use case. The simplest approach seems to be to use a Template pattern: first, create a template file that lives in the application directory. Then, when the user selects New File, the template is copied to the name and destination specified by the user in a New File dialog.
The alternative is a scripted approach: Use the same New File dialog, but dispense with the template file. Instead, create an empty SQL Co开发者_如何学运维mpact file using the name/destination specified by the user, and then execute a T-SQL script on it from managed code.
At this point, I am leaning toward the Template approach, because it is simpler. Is there any reason I should not use that approach? Thanks for your help.
I ended up going with a Template pattern. Pretty simple and it works fine in a desktop environment. I remain open to any suggestions on a better approach.
精彩评论