Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have the need to copy a database in MSDE using vb.net code, and I was wondering if anyone has done this that would not mind sharing the code.

 

I think the process would be something like:

 

1) Determine location of .mdf and .ldf file that you wish to copy

2) Detach database that you wish to copy

3) Copy the .mdf and .ldf file and rename to new name

4) Attach both the new and old database

 

As I quite new to vb.net the major problem that I can see with this is error handling, as you would always want the database that you are copying to be re-attached to SQL server.

 

Any help on this subject would be appreshiated.

 

Thanks

 

Simon

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...