Private Function Gelobee() As DataSet
Dim connection As OleDb.OleDbConnection = New OleDbConnection
connection.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=CMP.accdb"
connection.Open()
Dim da As OleDb.OleDbDataAdapter = New OleDbDataAdapter("SELECT IDDesc FROM [ItemDesc] WHERE " & PartNoTxt.Text & " ORDER BY IDID;", connection)
Dim ds As New DataSet
da.Fill(ds, "FilteredDesc")
Return ds
connection.Dispose()
connection = Nothing
DescTxt.Text = ds.Tables(0).Rows(1).Item(1)
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Gelobee()
End Sub
I am trying to get the result of the query in Function Gelobee to go to DescTxt.Text when I click the Button1. When I click the Button1, nothing appears in the DescTxt. No errors but It wont show the result in the textbox.