Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Fill Labels with SQL Search Results .Net

Fill Labels with SQL Search Results .Net

Scheduled Pinned Locked Moved Visual Basic
databasecsharpsecurityhelp
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jlawren7
    wrote on last edited by
    #1

    I need help finishing the code t fill the labels on my form with the search results. this i what i have (Not even sure this is gonna work as well ) 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) strSearchLName = txtLName.Text strSearchFName = txtFName.Text ' define strSQL 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 Labels with the Search results **This is where i Fail !!!!!** Cnxn.Close() ' Close everything Cnxn = Nothing Any Help would be appreciated Thank you the detail!!!! form name Contactinfo labels on theForm as follows.... lblFName lblLName lblAddress lblCity lblState lblZip lblPhone lblEmail lblPassID if possible this is gonna run in button Click event Thank You Scholars!!!:laugh: Help is great only if yu ask correctly

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups