How can I with \"code\" create a new .mdf/.sdf database?
I\'ve tried this: http://support.microsoft.com/kb/307283
All it does is fail on the ConnectionString
If you need to create a database from scratch programmatically i normal go into the SQL Server Management Studio and create it through the gui in a first step. But instead of clicking on the OK button in the bottom right, i click on the Script button in the top toolbar. This will give me a complete sql script for creating the database i'd like to have. Then i can alter the script and change the parts i'd like dynamically.