Imports System.Data.SqlServerCe
Public Class SQLCeCon
Private SQLCeCon As New SqlCeConnection("Data Source=au2015.sdf;Persist Security Info=False;")
Private SQLCeCmd As SqlCeCommand
Public SQLCeDA As SqlCeDataAdapter
Public SQLCeDT As DataTable
Public Params As New List(Of SqlCeParameter)
Public RecordCount As Integer
Public Exception As String
Public Sub ExecQuery(Query As String)
'Reset query stats'
RecordCount = 0
Exception = ""
Try
SQLCeCon.Open()
SQLCeCmd = New SqlCeConnection(Query, SQLCeCon)
Params.ForEach(Sub(p) SQLCeCmd.Parameters.Add(p))
Params.Clear()
SQLCeDT = New DataTable
SQLCeDA = New SqlCeDataAdapter(SQLCeCmd)
RecordCount = SQLCeDA.Fill(SQLCeDT)
Catch ex As Exception
Exception = ex.Message
End Try
If SQLCeCon.State - ConnectionState.Open Then SQLCeCon.Close()
End Sub
End Class
I’m receiving an error at New SqlCeConnection(Query, SQLCeCon)
which reads “Overload resolution failed because no accessible 'NEW
' accepts this number of arguments”.
I have no idea what this means my attempts to research the matter haven’t been helpful. I’m new to this forum board and a beginner with vb.net