noobre Posted April 24, 2015 at 09:58 AM Report Share #581776 Posted April 24, 2015 at 09:58 AM (edited) Boas, eu estou a usar o WampServer e tenho uma base de dados criada. Erro con.Open() : An unhandled exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll Imports System.Data.SqlClient Public Class Form1 Private Sub Form1_Load(sender As Object, e As EventArgs) End Sub Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim con As New SqlConnection Dim cmd As New SqlCommand Dim rd As SqlDataReader con.ConnectionString = "Server=localhost;Database=chatdb;Uid=root;Password=;" con.Open() cmd.CommandText = "select username, password from utilizadores where username = '" & login.Text & "' and password = '" & password.Text & "'" rd = cmd.ExecuteReader If rd.HasRows Then MsgBox("Connection Is okay.") 'chat.Show() Else MsgBox("Connection wasnt found.") End If End Sub End Class O que poderá ser ? Edited April 24, 2015 at 10:06 AM by apocsantos geshi Link to comment Share on other sites More sharing options...
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!Register a new account
Already have an account? Sign in here.Sign In Now