Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / June 2007

Tip: Looking for answers? Try searching our database.

using SMO to create a database, and choose location!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rogelio - 11 Jun 2007 20:53 GMT
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!
Nicholas Paldino [.NET/C# MVP] - 11 Jun 2007 21:06 GMT
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.

Signature

         - Nicholas Paldino [.NET/C# MVP]
         - mvp@spam.guard.caspershouse.com

> hey, I'm  using SMO to create a databas.e easy stuff
>
[quoted text clipped - 9 lines]
>
> I need the DB to be stored in a specific location only. THANKS!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.