Youtubede video izleyerek yapmaya çalıştığım programda aynı şeyleri yapmış olmama rağmen hata alıyorum. Daha önce aynı şekilde yaptığımda program sorunsuz bir şekilde çalışmaktaydı ve aynı sorun yüzünden hepsini silmek zorunda kaldım ve çözümünü malesef bulamadım yardımlarınızı bekliyorum.. Şimdiden Teşekkürler
Aldığım hata aşağıdaki resimdedir.
Referance kısmında mysql.data.dll ekli
PROJE KODLARI :
Aldığım hata aşağıdaki resimdedir.
Referance kısmında mysql.data.dll ekli
PROJE KODLARI :
Kod:
Imports MySql.Data.MySqlClient
Public Class MYDB
Private con As New MySqlConnection("Datasource=r.online;port=3306;username=r...;password=l....;database=r.......")
ReadOnly Property getConnection() As MySqlConnection
Get
Return con
End Get
End Property
Sub openConnection()
If con.State = ConnectionState.Closed Then
con.Open()
End If
End Sub
Sub closeConnection()
If con.State = ConnectionState.Open Then
con.Close()
End If
End Sub
End Class
Kod:
Imports MySql.Data.MySqlClient
Public Class LoginForm
Private Sub ButtonCikis_Click(sender As Object, e As EventArgs) Handles ButtonCikis.Click
Close()
End Sub
Private Sub ButtonGiris_Click(sender As Object, e As EventArgs) Handles ButtonGiris.Click
Dim db As New MYDB()
Dim adapter As New MySqlDataAdapter()
Dim table As New DataTable()
Dim command As New MySqlCommand("SELECT * FROM `giris` WHERE `k_adi` = @kadi and `sifre` = @sifre", db.getConnection)
command.Parameters.Add("@kadi", MySqlDbType.VarChar).Value = TextBoxKAdi.Text
command.Parameters.Add("@sifre", MySqlDbType.VarChar).Value = TextBoxSifre.Text
adapter.SelectCommand = command
adapter.Fill(table)
If table.Rows.Count > 0 Then
MsgBox("TRUE")
Else
MsgBox("FALSE")
End If
End Sub
Private Sub LoginForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
End Class



