Cancelling the backup/export process

Developer
Sep 27, 2012 at 7:13 AM
Edited Sep 27, 2012 at 7:17 AM

First of all i would like to introduce myself i'm Ivan Obillos from Ph. i 'm happy to be part of this project thank you adriancs for approving my request.


Regarding cancelling the backup process i encounter this error:

i was exporting my sample database when in the middle of the export i tried to cancel the process by executing/calling the

CancelExport()

i even use the demo program and it also have same error.

Object reference not set to an instance of an object.

void CloseConnection()
        {
            if (_cmd != null)
            {
                if (_cmd.Connection != null)
                {
                    if (_cmd.Connection.State != ConnectionState.Closed)
                    {
                        try
                        {
                            _cmd.Connection.Close();
                        }
                        catch
                        { }
                    }
                }
            }
            _cmd.Connection = null;
            _cmd = null;
        }

 

im new to c# but im trying to learn the language, im a visual basic programmer, and im hoping to be able to master C# language so i could make the Visual Basic equivalent of the MySqlBackup.net.

Thanks.

Coordinator
Sep 29, 2012 at 3:26 AM

Welcome, Ivan Obillos from Ph, thanks for the bug report. This will be fixed in the next version.

You can convert the entire project to Visual Basic easily by using tools like C# to VB.NET Converter.

by using the converter, you can easily learn and understand equivalent C# code to VB.NET.

example of code converters:

http://converter.telerik.com/

http://codeconvert.codeplex.com/

Developer
Oct 2, 2012 at 7:55 AM
Edited Oct 2, 2012 at 8:13 AM

Hi adriancs,

 

I already converted the project to VB.Net using the links you gave me, but when i tried to use it in my test application i have some issues

can you help me out on this?

I have here the link of the converted file

http://www.rarefile.net/c1r2jjg83cap/MySqlBackup.rar

So far this is the line that has an error, and it says: Arithmetic operation resulted in an overflow.

Public random As Random = New Random(CType(DateTime.Now.Ticks, Long))

Coordinator
Oct 15, 2012 at 8:42 AM

Hi, crazyivan,

The exception of null reference is raised when Cancelling the process is fixed.

You may review the new release version 1.5, available at download.

I have downloaded the file you uploaded.

Something I discovered, it seems that the style of global variable declaration is different between C# and VB.NET.

You still have to manually tweaks, modify some of the parts to make it run.

You can try to move/migrate all the global variable that cause the error in the Converted version to somewhere according to VB.NET coding style.