mysqlvb.netprocessor

dataAdapter.Fill(dataSet) stops executing for no apparent reason


I've recently been developing windows forms (in VB.NET) for an existing system at my workplace on my own personal laptop (64 bit). Everything was working fine, until I was recently provided with a much faster laptop (i7 also 64 bit).

So I copied the project folders directly from my older laptop to the newer laptop, installed the exact same versions of Visual Studio and MySQL and proceeded to get started on work.

The first few errors involved Crystal Report references targeting a different processor to that of the application. After some research I promptly solved the issue by changing the Target CPU to x64, when I encountered issues with a Form's [Design] View not loading because listViews were "never declared". After trying to Clean and Rebuild the solution multiple times with no success, I eventually fixed it by changing the Target CPU to AnyCPU.

But now an even stranger problem is occurring.

For sake of ease, this is a simplified example of how my code looks:

myConnection.ConnectionString = "Server=localhost;Database=myDB;Uid=root;Password=Root;"

myCommand = myConnection.CreateCommand()

myConnection.Open()

lstDealers.BeginUpdate()  

        With lstDealers

            .View = View.Details
            .Scrollable = True
            .GridLines = True
            .FullRowSelect = True

            With .Columns

                .Add("MONTH", 50, HorizontalAlignment.Left)
                .Add("DEAL NUMBER", -2, HorizontalAlignment.Right)
                .Add("DEALER", -2, HorizontalAlignment.Left)
                .Add("CLIENT", -2, HorizontalAlignment.Left)

            End With

        End With

    Dim myDataAdapter As MySqlDataAdapter = New MySqlDataAdapter
    Dim myDataTable As DataTable
    Dim myDataSet As DataSet = New DataSet

    myCommand.CommandText = "SELECT MONTH, " +
                            "DEAL_NO, " +
                            "DEALER, " +
                            "CUSTOMER " +
                            "FROM deals " +
                            "WHERE MONTH >= '" + searchDate + "' AND HIDDEN = 0 " +
                            "ORDER BY MONTH, DEAL_NO"

    myDataAdapter.SelectCommand = myCommand

    myDataAdapter.Fill(myDataSet)

Note the very last line:

myDataAdapter.Fill(myDataSet)

It is here that the execution simply stops. No errors or exceptions are seemingly being thrown. When I step through the code, it is here that it goes back to the form view with incomplete data as a lot of code is not being reached passed that line.

I've done some research, (this problem seems to be related to the target processor once again) and I've tried changing the Target CPU back to x86 just to see if it would run by that line, but to no avail.

I've even tried to make it:

myConnection.Close()

myDataAdapter.Fill(myDataSet)

myConnection.Open()

But still, nothing.

Any help would be appreciated.


Solution

  • I eventually figured out that the reason execution was simply stopping is because the appropriate exceptions under Exception Settings weren't selected, even by default.

    I managed to get Visual Studio to display the appropriate exceptions by:

    1. Pressing ctrl + alt + E

    2. Checking the Common Language Runtime Exceptions box in order to select all its subitems