connection to table and display results to labels
-
hi all i'm using VB.Net and i have a form that i need to have the results displayed into labels that populate the form. this is what i have so far **************** CODE ***************** Private Sub SearchTBBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles SearchTBBtn.Click Dim Cnxn As New ADODB.Connection Dim cmdChange As ADODB.Command 'Connection String Dim strCnxn As String 'SQL Query Dim strSQL As String 'search criteria Dim strSearchLName, strSearchFName As String Dim Now As DateTime Dim UserPassID As Integer UserPassID = Val(lblPassID.Text) 'Now = DateTime() ' Now = Format(Now, "h:nnAM/PM") strSearchLName = txtLName.Text strSearchFName = txtFName.Text ' define strSQLUpdate to insert the fields strSQL = "SELECT * FROM Contacts WHERE (LName) = '" & strSearchLName & "' AND (FName) = '" & strSearchFName & "'" strCnxn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\RMSC LOGIN\MYDataBase.mdb;Persist Security Info=False" Cnxn = New ADODB.Connection Cnxn.Open(strCnxn) cmdChange = New ADODB.Command ' Create command object cmdChange.ActiveConnection = Cnxn cmdChange.CommandText = strSQL cmdChange.Execute() ' execute the SQL command ' Fill the fields with the results '************* This is where i have a problem Dim rsContact As New ADODB.Recordset rsContact = cmdChange lblPassID.Refresh() lblLName.Refresh() Cnxn.Close() ' Close everything Cnxn = Nothing End Sub *************** END CODE ****************** i guess i don't knowhow to populate the labels with the results of cmdChange any help would be great thank you Help is great only if yu ask correctly