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. Web Development
  3. ASP.NET
  4. dropAssigned.SelectedValue.

dropAssigned.SelectedValue.

Scheduled Pinned Locked Moved ASP.NET
databasetutorial
2 Posts 2 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.
  • I Offline
    I Offline
    isaii
    wrote on last edited by
    #1

    Hello! I have this sql statement below: Dim strSQL As String = "SELECT EmailAdd from vwDepList where Member_ID =' " & dropAssigned.SelectedValue & "'" I want that my lblEmailAdd.text will refelect the value of strSQL depending on the dropAssigned.SelectedValue. Need a tutorial. Thanks.:)

    R 1 Reply Last reply
    0
    • I isaii

      Hello! I have this sql statement below: Dim strSQL As String = "SELECT EmailAdd from vwDepList where Member_ID =' " & dropAssigned.SelectedValue & "'" I want that my lblEmailAdd.text will refelect the value of strSQL depending on the dropAssigned.SelectedValue. Need a tutorial. Thanks.:)

      R Offline
      R Offline
      RepliCrux
      wrote on last edited by
      #2

      I am C# guy so I will write in C#. You can translate it into VB.NET lblEmailAdd.text = GetEmail(dropAssigned.SelectedValue) private String GetEmail(String memberID) { SqlCommand command = _Connection.CreateCommand(); String SQL = String.Format("SELECT EmailAdd from vwDepList where Member_ID = '{}'",memberID ); command.CommandText = SQL; command.CommandType = CommandType.Text; SqlDataAdapter adapter = new SqlDataAdapter(); adapter.SelectCommand = command; DataTable table = new DataTable() adapter.Fill(table); string email = (string)table.Rows[0]; return email. } Above _Connection is the SqlConnection to database. Hope that helps.

      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