Click here to Skip to main content
15,891,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi all

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

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

1 solution

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.

Regards,

AnilKumar.D
 
Share this answer
 
Comments
[no name] 8-Apr-13 5:20am    
@Anil: I know this but i need this thing through vb.net code..please see the tags..

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900