overload resolution failed because no accessible 'new' can be called with these arguments..
the error shows at the Dim dataadapter As New SqlDataAdapter(sqlCmd, connection)
Imports System.Data.SqlClient
Public Class Form1
Private Sub BtnGenResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnGenResult.Click
Dim ConnectionString As String = "Data Source=(local)\SQLEXPRESS; AttachDbFilename=D:\PKBW Batching System Data and Config\BatchingDatabase\Config\PK_BatchingConfig.mdf; ;User ID=sa;Password=1;"
Dim sqlCmd As New SqlCommand
Dim connection As New SqlConnection(ConnectionString)
Dim code As String
Dim dataadapter As New SqlDataAdapter(sqlCmd, connection)
Dim ds As New DataSet
code = Val(TextBoxIngCode.Text)
connection.Open()
dataadapter.Fill(ds, "Titles_table")
connection.Close()
sqlCmd.Connection = connection
sqlCmd = New SqlCommand _
("SELECT FormulaCode, BatchAbsNo, FormulaName, BatchStartTime, BatchFinishTime FROM dboBatchReportHeader WHERE FormulaCode = '" & TextBoxIngCode.Text & "'")
DataGridViewResult.DataSource = sqlCmd
End Sub
End Class
please help me to solve this issue..