I am creating a form to search a SQL Server database and return hits. I want to make a dataset of the table in SQL Server and then run select queries from there. What is the best way to do this? This is how I'm populating the dataset.
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim strSelect As String = "SELECT * FROM tblMail"
Dim dscmd As New SqlDataAdapter(strSelect, gConnection)
Dim dsMail As New DataSet()
dscmd.Fill(dsMail, "tblMail"
End Sub
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
Dim strSelect As String = "SELECT * FROM tblMail"
Dim dscmd As New SqlDataAdapter(strSelect, gConnection)
Dim dsMail As New DataSet()
dscmd.Fill(dsMail, "tblMail"
End Sub