Skip to content

Recuperar registro de la BBDD y dejar en un txtBox

December 22, 2011

Private Sub recullDades()

Try

Dim sSQL As String = “select nom from MAD_UsersRFID WHERE nom = ‘” & usuariAplic & “‘”

Dim idReader As SqlDataReader = New SqlCommand(cmdText:=sSQL, Connection:=cn).ExecuteReader()

With idReader

While .Read()

txtUserBD.Text = ((Trim(.GetString(0))))

End While

End With

idReader.Close()

Catch

MsgBox(Err.Number & ” “ & Err.Description, vbOKOnly, “ERROR”)

Exit Sub

End Try



End Sub

From → Datos

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: