C# Tutorial - Backup Database SQL Server | FoxLearn

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 115

  • @estebanyanson
    @estebanyanson 2 ปีที่แล้ว +2

    How can I get backup file from remote sql server ?
    Thanks

  • @estebangiraldo9792
    @estebangiraldo9792 ปีที่แล้ว

    to compress the backup which property should i use

  • @programador101
    @programador101 3 ปีที่แล้ว +1

    I can not find the libraries in vs 2017 also I have installed sql server 2017 :(

  • @MrValen1984
    @MrValen1984 2 ปีที่แล้ว

    I'm getting empty columns when restoring my backup...am I doing something wrong?...on the other hand the progress bar for my restore does not work...Thank you.

  • @josemenendez6219
    @josemenendez6219 2 ปีที่แล้ว

    Great Video but Will be cool if we were able to save it in the local computer using the application. For Example, I have a VPS and I like to Do backups without entering the VPS. So Doing the backup from my local computer and getting that file in my local computer without entering my vps will be awesome.

  • @rjevangelista9769
    @rjevangelista9769 6 ปีที่แล้ว

    Thanks! But how can I achieve to exclude specific table on backup?

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      You should generate a script, then you can run the script for the specified table. Thank you !

  • @ymn76ymn
    @ymn76ymn 6 ปีที่แล้ว

    There was error for me, because I have VS 2013 , I replaced with string.Format("{0}%",e.Percent) as you said , but nothing happened . please help..

  • @ahmedsalah6061
    @ahmedsalah6061 6 ปีที่แล้ว

    thank you very much for this helpful video

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว +1

      You're welcome. Thank you !

  • @samuelsenauluquipa445
    @samuelsenauluquipa445 4 ปีที่แล้ว

    my problem is that the DbBackup_PercentComplete method never gets executed. thanks

  • @dansad9475
    @dansad9475 7 ปีที่แล้ว

    why i code as above but don't backup ? Please help me

  • @adeelsiddiq186
    @adeelsiddiq186 4 ปีที่แล้ว

    No Library/extension/Reference found to add in my C# project that you added in your video for taking backup of SQL server I am using visual studio 2013 please help me out if there's any change now
    thanks in advance

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      You should install sql management studio, then you can get the library

    • @adeelsiddiq186
      @adeelsiddiq186 4 ปีที่แล้ว

      @@foxlearn sql management studio is installed and project is working properly in sql and wi dows forms as well 😥

  • @muhammadziadibrahim8078
    @muhammadziadibrahim8078 4 ปีที่แล้ว

    The code works fine. Thanks.
    But does it work on big databases too?

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      I think yes

    • @programador101
      @programador101 3 ปีที่แล้ว

      can you share your code please ?

  • @challenger7540
    @challenger7540 5 ปีที่แล้ว

    there are no those 4 libraries in vis.st.2013 how will we add ?

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      You should install sql server

    • @challenger7540
      @challenger7540 5 ปีที่แล้ว

      @@foxlearn already installed

  • @sygex5266
    @sygex5266 5 ปีที่แล้ว

    Hello there, Backup failed for Server . on Visual studio 13?!

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว

      Please check your code again. I think you miss something.

  • @victorjoaquin4
    @victorjoaquin4 2 ปีที่แล้ว

    Donde lo descargo ese ejemplo

  • @pulasthibasnayake403
    @pulasthibasnayake403 6 ปีที่แล้ว

    Backup failed for Server .why is that??

  • @alqbati2023
    @alqbati2023 4 ปีที่แล้ว

    Thank you very much

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      Thank you !

  • @wordpresswithdhaval4161
    @wordpresswithdhaval4161 7 ปีที่แล้ว

    it is posible to backup the data from local database

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว +1

      Yes, You can backup data from local database

    • @wordpresswithdhaval4161
      @wordpresswithdhaval4161 7 ปีที่แล้ว

      how can give me code
      on this Id gevariyadhaval@gmail.com

    • @wordpresswithdhaval4161
      @wordpresswithdhaval4161 7 ปีที่แล้ว

      otherwise can you give me some idea how to backup data in local database with .net c#

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว

      Similar code, only need to change your connection string

    • @challenger7540
      @challenger7540 5 ปีที่แล้ว

      @@foxlearn say we have a program with database..How can we back up db while it s working ?

  • @eamchet2680
    @eamchet2680 4 ปีที่แล้ว

    Hi Fox Learn
    I have use Oracle 12c can you help me create app backup?
    Thanks

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      sorry man. i don't use oracle

  • @Fadisayegh18
    @Fadisayegh18 ปีที่แล้ว

    how to download this libraries?

  • @myvominh6667
    @myvominh6667 8 ปีที่แล้ว

    Can u tell me where you take this voice for all video of your channel. Sound like voice of some OS.... Thanks

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Natural text to speech. Thanks

  • @ahsanali3857
    @ahsanali3857 8 ปีที่แล้ว

    how to store this backup to UBS or Dropbox using c#

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Ok. Thank you for your suggestion

  • @bishoynabil5303
    @bishoynabil5303 4 ปีที่แล้ว

    thank you

  • @chuckt5930
    @chuckt5930 8 ปีที่แล้ว

    these characters $ and % are giving an error how did you do it foxlearn

    • @chacataplan
      @chacataplan 8 ปีที่แล้ว

      $"{e.Percent}%"; pls error

    • @foxlearn
      @foxlearn  8 ปีที่แล้ว +1

      Hi, It using in C# 6.0, you can replace string.Format("{0}%",e.Percent). thanks

    • @ymn76ymn
      @ymn76ymn 6 ปีที่แล้ว

      If you have no VS 2015 you can't using the $ " " , but there is another way .. string.Format("{0}%",e.Perecent)

  • @challenger7540
    @challenger7540 5 ปีที่แล้ว

    say we have a program with database..How can we back up database while it s working ?(local db)

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      You should set your database is single user, then backup. Next, back on multiple user

    • @challenger7540
      @challenger7540 5 ปีที่แล้ว

      @@foxlearn this time it says "User does not have permission to alter database 'mydb', the database does not exist, or the database is not in a state that allows access checks."

  • @flutterify
    @flutterify 5 ปีที่แล้ว

    i didn't find the libraries in vs2013

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      You should install sql server, then you can find the library

    • @flutterify
      @flutterify 5 ปีที่แล้ว

      @@foxlearn i am working with local database how do i backup local database

  • @TuanHoang-fy2ws
    @TuanHoang-fy2ws 5 ปีที่แล้ว

    Chào ad, mình đã làm giống hệt bạn mà lúc backup không được, cũng không báo lỗi gì . Bạn hướng dẫn mình với

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      What error are you getting? thank you !

    • @TuanHoang-fy2ws
      @TuanHoang-fy2ws 5 ปีที่แล้ว

      @@foxlearn cảm ơn ad. Mình tìm ra lỗi rồi. Các bài viết của bạn rất có ích

    •  4 ปีที่แล้ว

      @@TuanHoang-fy2ws bạn fix ntn vậy? mình bấm vào cũng không có báo lỗi gì hết nhưng nó không chạy

  • @mohamednaser2128
    @mohamednaser2128 5 ปีที่แล้ว

    Error 7 The type 'Microsoft.SqlServer.Management.Sdk.Sfc.IAlienObject' is defined in an assembly that is not referenced. You must add a reference to assembly 'Microsoft.SqlServer.Management.Sdk.Sfc, Version=12.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91'. C:\Users\Mohamed\Desktop\Ray_Connect\Ray_Connect\Ray_Connect\Form_backup.cs 55 17 Ray_Connect
    hi the error fix Please

    • @foxlearn
      @foxlearn  5 ปีที่แล้ว +1

      You must add a reference to assembly 'Microsoft.SqlServer.Management.Sdk.Sfc

    • @mohamednaser2128
      @mohamednaser2128 5 ปีที่แล้ว

      @@foxlearn Thank you for your response, but can you explain more

    • @pritiwagh6164
      @pritiwagh6164 ปีที่แล้ว

      @@foxlearn how to add refrences

  • @yourspdahal5606
    @yourspdahal5606 4 ปีที่แล้ว

    how to closed my form when await task finished. l have a large database back time out problem . i hope this process solve but not closed my form when task completed. please help me .

    • @yourspdahal5606
      @yourspdahal5606 4 ปีที่แล้ว

      no reply

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      this.Close()

    • @yourspdahal5606
      @yourspdahal5606 4 ปีที่แล้ว

      @@foxlearn System.InvalidOperationException was unhandled by user code
      HResult=-2146233079
      Message=Cross-thread operation not valid: Control 'BackupsFiles' accessed from a thread other than the thread it was created on.
      Source=System.Windows.Forms
      StackTrace:
      at System.Windows.Forms.Control.get_Handle()
      at System.Windows.Forms.Control.SendMessage(Int32 msg, Int32 wparam, Int32 lparam)
      at System.Windows.Forms.Form.Close()
      at CoopSoft.BackupsFiles.pricesscompletedall() in d:\NASABACKUP\CoopSoft\CoopSoft\BackupsFiles.cs:line 184
      at CoopSoft.BackupsFiles.dbbackup_PercentComplete(Object sender, PercentCompleteEventArgs e) in d:\NASABACKUP\CoopSoft\CoopSoft\BackupsFiles.cs:line 114
      at Microsoft.SqlServer.Management.Smo.BackupRestoreBase.OnInfoMessage(Object sender, ServerMessageEventArgs e)
      at Microsoft.SqlServer.Management.Common.ServerMessageEventHandler.Invoke(Object sender, ServerMessageEventArgs e)
      at Microsoft.SqlServer.Management.Common.ConnectionManager.SerializeInfoMessage(Object sender, SqlInfoMessageEventArgs e)
      at System.Data.SqlClient.SqlConnection.OnInfoMessage(SqlInfoMessageEventArgs imevent, Boolean& notified)
      InnerException:

  • @anshuvishwakarma6020
    @anshuvishwakarma6020 4 ปีที่แล้ว

    How to create autobackup.

    • @foxlearn
      @foxlearn  4 ปีที่แล้ว

      You can create a schedule in your sql server

  • @CarlosGarcia-ct2mv
    @CarlosGarcia-ct2mv 7 ปีที่แล้ว

    I have a problem with progressbar , not update .
    thank you so much :D

    • @foxlearn
      @foxlearn  7 ปีที่แล้ว +1

      Hi, You need to set value to your progress bar in backup event. Please try again. Thank you

  • @maherbabar3315
    @maherbabar3315 6 ปีที่แล้ว

    How can i use this code on windows authentication
    I did not create Sql Sever Authentication Help me plz

  • @gustavolopes4066
    @gustavolopes4066 3 ปีที่แล้ว

    Alguém poderia me ajudar ? no Visual Studio 2019 não estou conseguindo adicionar a dependência que foi utilizado no vídeo

    • @username-dh4tq
      @username-dh4tq 2 ปีที่แล้ว

      #barakuda
      #cinderawasih
      #metromini
      @origa

    • @username-dh4tq
      @username-dh4tq 2 ปีที่แล้ว

      republic palestina indonesian republic
      #propaganda

  • @alm0nd.359
    @alm0nd.359 3 ปีที่แล้ว

    Thanks Foxlearn, you helped me a lot of :°)

  • @Ahmad_Hamdy_Hamdeen
    @Ahmad_Hamdy_Hamdeen 2 ปีที่แล้ว

    sql query:
    Backup DATABASE [DatabaseName] TO DISK = N'D:Back.back'
    😍😍

  • @Noss454
    @Noss454 6 ปีที่แล้ว

    Access Denied :( And I can not solve with code.

    • @foxlearn
      @foxlearn  6 ปีที่แล้ว

      I think you should set permission allows you to access the backup file

    • @Noss454
      @Noss454 6 ปีที่แล้ว

      I know, but i can't do this manually. Set permission via script ^^

  • @victorjoaquin4
    @victorjoaquin4 2 ปีที่แล้ว

    Fuentes

  • @Ahmad_Hamdy_Hamdeen
    @Ahmad_Hamdy_Hamdeen 2 ปีที่แล้ว

    using (var context = new ApplicationDbContext())
    {
    string currentDatetime = DateTime.Now.ToString("yyyy-MM-dd 'at' HH.mm");
    string backupPath =
    $@"Backup DATABASE [DatabaseName] TO DISK = N'{Environment.CurrentDirectory}\Backups\{currentDatetime} Backup'";
    context.Database.ExecuteSqlCommand(TransactionalBehavior.DoNotEnsureTransaction, backupPath);
    }