Dim cmd As OleDbCommand = Nothing
Dim smd_search As String = "select * from Old_info where UG_PG='BSc'"
Dim con As OleDbConnection = New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=E:\Bavu's\project\vb files\dms\SPA_Database.accdb")
Dim myDa As OleDbDataAdapter
Dim mydataset As DataSet
cmd = New OleDbCommand(smd_search, con)
myDa = New OleDbDataAdapter(cmd)
mydataset = New DataSet()
Try
If con.State = ConnectionState.Closed Then
con.Open()
myDa.Fill(mydataset, "Old_info")
search_data_DataGridView.DataSource = mydataset.Tables("Old_inf0").DefaultView
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
`Inline Code Example Here`
jamshi213 0 Newbie Poster
thines01 401 Postaholic Team Colleague Featured Poster
Begginnerdev 256 Junior Poster
thines01 commented: Good catch +12
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.