Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

Mysqlexception Was Nnhandled !! How to Fixed it ??

$
0
0
I have a problem about mysql in vb net 2010. when i connect to a mysql database vb net 2010, there was a warning " mysqlexception was unhandled " , No database selected.

it occurs in
Quote:

RD = Cmd.ExecuteReader()
following his script :

Quote:

Private Sub btnCari_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCari.Click
If RadioButton1.Checked = True Then
Using Koneksi As New MySqlConnection
Koneksi.Open()
Cmd = New MySqlCommand("Select * From kamus where Indonesia='" & txtCari.Text & "'", Koneksi)
RD = Cmd.ExecuteReader()
RD.Read()
If RD.HasRows = True Then
txtArti.Text = RD.Item("Dayak")
End If
tampil()
End Using

ElseIf RadioButton2.Checked = True Then
Using Koneksi As New MySqlConnection
Koneksi.Open()
Cmd = New MySqlCommand("Select * From kamus where Dayak='" & txtCari.Text & "'", Koneksi)
RD = Cmd.ExecuteReader()
RD.Read()
If RD.HasRows = True Then
txtArti.Text = RD.Item("Indonesia")
End If
tampil()
End Using

End If
End Sub
Help me ?? T_T

Viewing all articles
Browse latest Browse all 27513

Trending Articles



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