到SQL所以我想我的SQL數據庫連接到我的VB項目,但它給了我這個錯誤:錯誤連接用VB
Error Connecting to Database : Authentication to host "for user" using method 'mysql_native_password' failed with message : Acces denied for user "@'N56VB' (using password : NO)
N56VB是我的電腦
UPDATE錯誤至極我現在得到是:類型的第一次機會異常
'System.ArgumentException' occurred in System.Data.dll
Additional information: Keyword not supported.
If there is a handler for this exception, the program may be safely continued
我不知道該怎麼辦了這將是一個愚蠢的我猜,很容易對我,我一個小白:( 我希望有人知道這個問題的
Imports MySql.Data.MySqlClient
Imports System.Data.Sql
Imports System
Imports System.Data
Public Class NieuweItems
Public dbconn As New MySqlConnection("Data Source=localhost;user id=root;password=;database=gip;")
Dim conn As New MySqlConnection
Private Sub btn_return_Click(sender As Object, e As EventArgs) Handles btn_return.Click
Me.Close()
SalesApplication.Show()
End Sub
Private Sub btn_inlezen_Click(sender As Object, e As EventArgs) Handles btn_inlezen.Click
Dim sqlCommand As New MySqlCommand
Dim SQLConnection As MySqlConnection = New MySqlConnection
Dim strStockSQL As String
SQLConnection.ConnectionString = "Data Source= localhost ;user id = root'@'localhost; password = ;database=gip;table=stock;"
Try
conn.Open()
strStockSQL = "INSERT INTO Barcode " & txtBarcode.Text & "INSERT INTO Naam_Product" & txtNaam.Text & "INSERT INTO Verkoopprijs" & txtVP.Text
sqlCommand.ExecuteNonQuery()
SQLConnection.Close()
conn.Close()
Catch myerror As MySqlException
MessageBox.Show("Error Connecting to Database: " & myerror.Message)
Finally
conn.Close()
End Try
End Sub
End Class
http://www.connectionstrings.com/mysql-connector-net-mysqlconnection/ – Plutonix