You are best learning channel.So as that i will thank you. be sure There are beneficiaries here.thnx..
@foxlearn8 жыл бұрын
You're welcome. Thank you so much
@phimhayaaaa5 жыл бұрын
Help me please, It not working for me. It runs without errors but can't restore database. I use SQL server 2018. Thank you so much
@foxlearn5 жыл бұрын
What error are you getting? you can't restore the database is running
@phimhayaaaa5 жыл бұрын
@@foxlearn My program can't run DbRestore_Complete and DbRestore_PercentComplete
@mohammadzaroo8 жыл бұрын
Help me pls ,,, how to import the four libraries from extension using visual studio 2010 ?? i cant find any of them from the add reference dialog form ....
@foxlearn8 жыл бұрын
Hi, You can install from nuget, You need to download nuget and install to your computer. Thanks
@shubhamsahuSD6 жыл бұрын
//it works fine with my first pc but notwork in another pc error because ot this line because first i need to close all connection else it is not resorting dbServer.KillAllProcesses(dbRestore.Database); dbRestore.Devices.AddDevice(fileLocation, DeviceType.File); dbRestore.PercentComplete += DbRestore_PercentComplete; dbRestore.Complete += DbRestore_Complete; dbRestore.SqlRestoreAsync(dbServer); unable to restore it gives an error message "drop all active database connection failed"
@foxlearn6 жыл бұрын
That's right. You should set single user, then you can restore
@shubhamsahuSD6 жыл бұрын
but there is multiple user using sql server. but it is Working fine on another pc with multiple user. actually i created database on first pc which can restore database on multiuser but if i am restore same data base to another pc with same version of sql server not working
@shubhamsahuSD6 жыл бұрын
after setting single user now i can't even access database
@foxlearn6 жыл бұрын
The best solution using script to restore database instead of using the sql library
@shubhamsahuSD6 жыл бұрын
got it.... there was some settings problem with sql database engine i copied my DATA folder of 1st PC to 2nd PC sql directory now working fine and script idea is also working ;)
@afzalhossainbd5 жыл бұрын
I was trying to use backup and restore from in the same project but it didn't work! It works on a different project for Backup and Restores. Is there anything that I am missing to work both in the same project? I was reading below but didn't really understand the flow. Can someone elaborate please?
@foxlearn5 жыл бұрын
You should close connection, then you can backup and restore database. You can't backup or restore the database if your application connect to the database.
@yaqoopal-yafei72136 жыл бұрын
How can use this method when server without security no user name and no passowrd
@mshehryar5 жыл бұрын
in my visual studio 2013 i can not add reference what can i do ?
@foxlearn5 жыл бұрын
You should install sql server
@darpanrelan61978 жыл бұрын
Could not load file or assembly 'Microsoft.SqlServer.SqlClrProvider, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' or one of its dependencies. The system cannot find the file specified.
@foxlearn8 жыл бұрын
Hi, You need to download and install microsoft sql server, then try again. Thanks
@darpanrelan61978 жыл бұрын
i'm already installed this software SQL 2012 version. :(
@chetrathon46607 жыл бұрын
Are you use other class?
@suprayogihermawan47444 жыл бұрын
Thanks, work fine to me
@foxlearn4 жыл бұрын
Thank you !
@maykonduarte6 жыл бұрын
Hello, how do I restore if the database does not exist?
@anshuvishwakarma60204 жыл бұрын
How to backup data by given time like schedule backup.
@foxlearn4 жыл бұрын
OK. Thank you for your suggestion !
@yaqoopal-yafei72138 жыл бұрын
Thanks a lot
@foxlearn8 жыл бұрын
Thank you ^_^
@autobot5207 жыл бұрын
It's not working for me. Please send me your code. Thanks!
@mohammadaldaqqouri81744 жыл бұрын
it works only one time when try to restore another database nothing happen and no error appear
@foxlearn4 жыл бұрын
you should disconnect user, then try to restore
@supercoco327 жыл бұрын
Does not restore backuo, I am using vs 2012 and sqlserver 2012 References 11.0.0.0 Try { String path = locationTextBox.Text; Server dbSerber = new Server (new ServerConnection (".", "Jordi", "esosto")); Restore dbRestore = new Restore () {Database = "Blanque", Action = RestoreActionType.Database, ReplaceDatabase = true, NoRecovery = false}; DbRestore.Devices.AddDevice (path, DeviceType.File); DbRestore.PercentComplete + = dbRestore_PercentComplete; DbRestore.Complete + = dbRestore_Complete; DbRestore.SqlRestoreAsync (dbSerber); } Thank you.
@foxlearn7 жыл бұрын
Hi, Please check your connection string, make sure no connection to your database restore. Thanks
@clidton7 жыл бұрын
backup is working fine your code but there is a issue in restoring finally i solved before adddevice code first Kill all processes dbServer.KillAllProcesses(dbRestore.Database);
@yassiremtioui41316 жыл бұрын
Thaanks A lot ♥
@shubhamsahuSD6 жыл бұрын
Thanks
@hieunguyenhieu65815 жыл бұрын
Thanks :))
@pauloflores154 жыл бұрын
Thank you so much for this!
@bryanbalaga66204 жыл бұрын
This saves my day! Thanks! :)
@alm0nd.3593 жыл бұрын
Hi Bro, first all Thanks for the whole of tutos. I do have a problem: The backup works perfectly, but the restore do not. Sometimes it works, most of the time not. And the stressful thing is : I got none error message. TRY CATCH send back nothings !
@alm0nd.3593 жыл бұрын
i finally fixed the problem. Thinking it is maybe because of SQL connection pool. Fortunately it was that. So I put this before restore code : SqlConnection.ClearAllPools(); MAGIC it works : Several and several tests every thing is clean.