Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
VB
Private Sub btnFill_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnFill.Click
        'Dim MysqlConn As New MySqlConnection("server=103.50.163.157;database=mayarrod_mdemo;user id=" & TextBox1.Text & " ; password=" & TextBox2.Text & ";")
        Dim MysqlConn As New MySqlConnection("server=127.0.0.1;database=mayarrod_mdemo;user id=" & TextBox1.Text & ";password=" & TextBox2.Text & ";Connect Timeout=21600;")


        Try
            MysqlConn.Open()
            SQL = "SELECT * FROM StudentRegistration"
            ContactsCommand.Connection = MysqlConn
            ContactsCommand.CommandText = SQL

            ContactsAdapter.SelectCommand = ContactsCommand
            ContactsAdapter.Fill(ContactsData) '<<-------- Error (Fetal read data)

            DataGridView1.DataSource = ContactsData

        Catch myerror As MySqlException
            MessageBox.Show("Cannot connect to database: " & myerror.Message)
        Finally
            MysqlConn.Close()
            MysqlConn.Dispose()
        End Try

    End Sub


What I have tried:

Fatal error encountered attempting to read the resultset. Mysql
Posted
Updated 1-Jul-20 22:16pm

1 solution

At a guess - and since we can't access your database that's all it can be - it's taking too long for some reason. You could try the advice here: MySQL Bugs: #61807: Fatal error encountered during data read[^] but if that doesn't solve it, you'll need to use the debugger to look at the whole exception object and see if there is any further info in the InnerException or stack trace.

We can't do that for you!
 
Share this answer
 
Comments
Maciej Los 2-Jul-20 4:31am    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900