By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,562 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,562 IT Pros & Developers. It's quick & easy.

using SMO to create a database, and choose location!

P: n/a
hey, I'm using SMO to create a databas.e easy stuff

ServerConnection srvcon = new
ServerConnection("MYCOMPUTER");
Server serv = new Server(srvcon);

Database db = new Database(serv, "MyDatabase");

db.Create();

but where can I modify the filename properties??

I need the DB to be stored in a specific location only. THANKS!
Jun 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rogelio,

The Database class exposes the FileGroups property which has the
filegroups which are used for the database. When creating a new instance,
you will want to work with this property (and the objects it exposes) to set
the filegroup for the new database.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Rogelio" <Ro*****@discussions.microsoft.comwrote in message
news:54**********************************@microsof t.com...
hey, I'm using SMO to create a databas.e easy stuff

ServerConnection srvcon = new
ServerConnection("MYCOMPUTER");
Server serv = new Server(srvcon);

Database db = new Database(serv, "MyDatabase");

db.Create();

but where can I modify the filename properties??

I need the DB to be stored in a specific location only. THANKS!

Jun 11 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.