Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,693 members, 7,955,622 topics. Date: Sunday, 22 September 2024 at 11:03 AM |
Nairaland Forum / Science/Technology / Programming / Vb.net Programmer Please come in and Help (1733 Views)
Experienced Asp.net Programmer Wanted For Immediate Employment / I Need To Learn Php And Vb.net / Cloudbridge LLC Needs A Java, C# C++, Visualbasic Or Vb.net Programmer Urgenlty (2) (3) (4)
Vb.net Programmer Please come in and Help by OPEYEMIAD(m): 6:29pm On Dec 24, 2015 |
Am trying to Back up and restore my database, so have tried all my possible best here is my code FOR THE BACK UP Imports MySql.Data.MySqlClient 'i import this statement before my public class formname connectme() ' Have established a working connection with this already dim strsql as string strsql = "BACKUP DATABASE dbname TO DISK = C:\Users\LAPTOP\Desktop\dbname.sql" Dim cmd As New MySqlCommand(strsql, con) cmd.ExecuteNonQuery() con.Close() ......................................Note: MySql.Data.dll is my reference This is the error i got An unhandled exception of type 'MySql.Data.MySqlClient.MySqlException' occurred in MySql.Data.dll Additional information: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BACKUP DATABASE dbname TO DISK = C:\Users\LAPTOP\Desktop\dbname.sql' at line 1 FOR THE RESTORE dim strsql as string strsql = "RESTORE DATABASE dbname FROM DISK = C:\Users\LAPTOP\Desktop\dbname.sql" Dim cmd As New MySqlCommand(strsql, con) cmd.ExecuteNonQuery() con.Close() Your urgent intervention will be highly welcome and appreciated. |
Re: Vb.net Programmer Please come in and Help by Nobody: 6:37pm On Dec 24, 2015 |
download the code below and use the view www.java2s.com/Open-Source/AspDotNet_Free_Code/Database/Download_MySqlBackup_NET_MySQL_Backup_Solution_for_C_VB_NET_ASP_NET.htm |
Re: Vb.net Programmer Please come in and Help by Nobody: 6:44pm On Dec 24, 2015 |
What version of vs do you use I use vs2015 . |
Re: Vb.net Programmer Please come in and Help by OPEYEMIAD(m): 6:51pm On Dec 24, 2015 |
proxy20: i use 2013 |
Re: Vb.net Programmer Please come in and Help by Nobody: 6:54pm On Dec 24, 2015 |
Where can I get 2015 tutorials. 2015 is a bit different from 2013. video and pdf . |
Re: Vb.net Programmer Please come in and Help by OPEYEMIAD(m): 7:00pm On Dec 24, 2015 |
proxy20: thanks Having checked the demo I have problem with mysqlbackup.dll refrence at run time so its practically impossible for me to use.. it will be nice if my above code can be corrected |
Re: Vb.net Programmer Please come in and Help by OPEYEMIAD(m): 9:49am On Dec 25, 2015 |
problem not yet solve
am still waiting |
Re: Vb.net Programmer Please come in and Help by OPEYEMIAD(m): 8:14pm On Dec 25, 2015 |
Hmm after several research i was able to solve the problem. for learning purposes i add mysql.data.dll and mysqlbackup. dll as reference then the code [b]If txtBackupFile.Text = " " Then MsgBox("No location selected", MsgBoxStyle.Critical, "Error Exporting Database" btnBrowse.Focus() Exit Sub Else connectme() Dim cmd As MySqlCommand = New MySqlCommand cmd.Connection = con Dim mb As MySqlBackup = New MySqlBackup(cmd) Try If txtrestore.Text = "0" Then mb.ExportToFile(txtBackupFile.Text) MsgBox("Database Exported", MsgBoxStyle.Information, "Export Success" ElseIf txtBackupFile.Text = "0" Then mb.ImportFromFile(txtrestore.Text) MsgBox("Database Imported", MsgBoxStyle.Information, "Import Success" End If con.Close() Catch ex As Exception MsgBox(ex.Message, MsgBoxStyle.Critical, "Error" Exit Sub End Try End If[/b] But i encounter another bigger problem i store images into my database size of all the record amounting to 4MB after exporting am unable to import it due to the size my questions: 1. what is the best way to store images into database ? 2. How do i import already exported database? i just upgrade my phpmyadmin so i cant continue without importing my database please help |
Re: Vb.net Programmer Please come in and Help by OPEYEMIAD(m): 8:30am On Dec 26, 2015 |
OPEYEMIAD: i edit my php.ini inside my phpmyadmin theremy enable me to upload upto 900M file size but still showing error during importation then I open the sql file using notepad and delete all the converted binary file. then i copied only the sql command and run it inside phpmyadmin everything work fine forgive me for asking question and answering my self |
Re: Vb.net Programmer Please come in and Help by demolinton4comi: 11:38pm On Dec 29, 2015 |
If this might help is not very good to store but pics and videoin inside database ur programma be slow try and store it inside a folder then u store the location and name inside ur db |
(1) (Reply)
Nairaland Homepage Bug / C# Vs Java / We Love Colors - Android App.
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 20 |