Hi,
So I have a TableAdapter (created by the designer) that fills a table like this.
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.
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.