Create .mdf/.sdf database dynamically

后端 未结 7 974
萌比男神i
萌比男神i 2020-12-29 11:21

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

7条回答
  •  情深已故
    2020-12-29 12:13

    Use a connectionString with InitialCatalog = master. Since only master has default access to create a database.

提交回复
热议问题