Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15079

[RESOLVED] Weird error right after the db server goes up after being down.

$
0
0
Hi,

So I have a TableAdapter (created by the designer) that fills a table like this.

Code:

Try
        cmd.Connection.Open()
        MyTableAdapter.Fill(MyDataSet.MyTable)
        cmd.Connection.Close()
Catch ex As Exception
        cmd.Connection.Close()
        Throw
End Try


When the db server is up it works fine.
When the db server is down it gives out this error:

MySqlException was caught:
Unable to connect to any of the specified MySQL hosts.


Which is fine too as it's expected.

The problem is when the server goes down and the above error gets thrown and then the server goes up again. When the code gets executed then it gives out this error:

MySqlException was caught:
Fatal error encountered during command execution.


This error happens only the first time the code executed right after the server goes up. When it gets executed the second time (and all the times that follow) it works fine. Which is wired.

Any enlightenment would be very appreciated.

Viewing all articles
Browse latest Browse all 15079

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>