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. Select Case statement

Select Case statement

Scheduled Pinned Locked Moved ASP.NET
databasetutorialquestion
3 Posts 3 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

    Hi, I have this sql statement: Dim strSQL2 As String = "Select Dep_code from vwDepList where Member_ID =" & EmailAddID Can I put it in a Select Case statement? Select case strSQL2 Case "1" label1.text = "hello" so on.... End select How will I do this? Need a tutorial. Thanks in advance.

    E U 2 Replies Last reply
    0
    • I isaii

      Hi, I have this sql statement: Dim strSQL2 As String = "Select Dep_code from vwDepList where Member_ID =" & EmailAddID Can I put it in a Select Case statement? Select case strSQL2 Case "1" label1.text = "hello" so on.... End select How will I do this? Need a tutorial. Thanks in advance.

      E Offline
      E Offline
      Eduard Keilholz
      wrote on last edited by
      #2

      Erhm, I totally don't understand your question and the code seems really weird! You can compare the case construction with an 'if' kind of construction Dim s as string = "a" Select case s Case "a" Do something Case "b" Do Something else End Select The case block's result here would exactly match the following if construction Dim s as string = "a" If (s = "a") Then Do something Else if (s = "b") Then Do something else End If

      .: I love it when a plan comes together :. http://www.zonderpunt.nl

      1 Reply Last reply
      0
      • I isaii

        Hi, I have this sql statement: Dim strSQL2 As String = "Select Dep_code from vwDepList where Member_ID =" & EmailAddID Can I put it in a Select Case statement? Select case strSQL2 Case "1" label1.text = "hello" so on.... End select How will I do this? Need a tutorial. Thanks in advance.

        U Offline
        U Offline
        Urs Enzler
        wrote on last edited by
        #3

        Just as a side note: Do not concatenate query strings! Use Parameters!! Better performance, easier to program (i.e. DateTime format problems), stringer against SQL injection.

        -^-^-^-^-^- no risk no funk

        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