Click here to Skip to main content
13,046,773 members (56,612 online)
Rate this:
Please Sign up or sign in to vote.
Hi all

Please tell me how to override an existing database with an updated file using VB.NET.

Thank you
Posted 7-Apr-13 21:53pm
Updated 7-Apr-13 23:20pm

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Dear Friend,

In sql server Management Studio.Select one Database Right Click on that.There you will get one Option Task,in that you will get restore option.Click that Restore Option you will get Database.Click that Database there it will open One Window and You will get one Option name Device.It is Radio Button Option.and beside that only there is one button.By clicking that one another Window will Open.In that windows there is Add option Button.By clicking that one you will get one windows.By using that windows you can fetch the .Bak file from the drives.By selecting the back file click ok button.In the last Main Window there is three options.General,Files,Option.In that you take files option.In that Restore as tab is there C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\Bank.mdf change Bank.mdf to your current database filename.Same thing should change in fileType log also.and last there is options button.By selecting that one.You will get three radio button option like this
1:Overwrite the Existing Database.

By Checking that one and Press ok Button and your Database will be restored.


Snehasish Nandy 8-Apr-13 5:20am
@Anil: I know this but i need this thing through code..please see the tags..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 8 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100