简体   繁体   中英

The system cannot find the file specified when backup the database

I'm trying to backup my sql database. I try use this first

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click

    Process.Start("C:\Users\user\Desktop\Thesis\BACKUP feb 15\capstone_real\capstone_real\Resources\mysqldump.exe", " -u root -padmin capstone -r ""C:\Users\user\Desktop\Thesis\backup1.sql""")

End Sub

it works.. but I didn't want to specified the directory like this so try this

     Process.Start(" " & Application.StartupPath & "\Resources\mysqldump.exe,  -u root -padmin capstone -r ""C:\Users\user\Desktop\Thesis\backup2.sql""")

Didn't work (The system cannot find the file specified)

Points to Note

  1. Application.StartupPath returns path like C:\\ xyz derectories\\bin\\debug
  2. Verify the debug folder contains required Directory
  3. If every thing is fine still not getting work then this may happen because of initial space added to Application.StartupPath

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM