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