I am new to programming and I am working on a project using SQL and VB in Visual Studio 2013. One of the errors that has me stumped is as follows:
Imports System.Data
Imports System.Data.SqlClient
This error occurs at the following line:
da.Fill(ds)
Under additional information the following message is included:
Additional information: Invalid object name 'Complaints'.
I do have a Form named "Complaints" What am I missing? Thanks for any help you can provide! Please find the code below:
Public Class DButil
Public cs As String
Public Function GetDataView(ByVal sql As String) As DataView
Dim ds As New DataSet
Dim da As New SqlDataAdapter(sql, cs)
da.Fill(ds)
Dim dv As New DataView(ds.Tables(0))
Return dv
End Function
Public Sub New()
Dim strPath As String = Replace(System.AppDomain.CurrentDomain.BaseDirectory, "bin\debug", "cms.mdf")
cs = "Data Source=(LocalDB)\v11.0;"
cs += "AttachDbFilename='C:\Users\Sean\Documents\Visual Studio 2013\Projects\349591\349591\cms.mdf';Integrated Security=True"
cs += "Integrated Security=True;Connect Timeout=30"
End Sub
End Class