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. C#
  4. If, Else.. what's wrong?

If, Else.. what's wrong?

Scheduled Pinned Locked Moved C#
question
6 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.
  • R Offline
    R Offline
    Rmokkenstorm
    wrote on last edited by
    #1

    if (":PARAM2" != string.Empty) { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = txtBorgtochtNummer.Text; } else { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = "%"; } why doesn't he fill up the PARAM2 whit a "%" ?

    E 1 Reply Last reply
    0
    • R Rmokkenstorm

      if (":PARAM2" != string.Empty) { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = txtBorgtochtNummer.Text; } else { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = "%"; } why doesn't he fill up the PARAM2 whit a "%" ?

      E Offline
      E Offline
      Eric Dahlvang
      wrote on last edited by
      #2

      if (oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value != string.Empty) { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = txtBorgtochtNummer.Text; } else { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = "%"; } Eric Dahlvang-Programmer

      R 1 Reply Last reply
      0
      • E Eric Dahlvang

        if (oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value != string.Empty) { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = txtBorgtochtNummer.Text; } else { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = "%"; } Eric Dahlvang-Programmer

        R Offline
        R Offline
        Rmokkenstorm
        wrote on last edited by
        #3

        doesn't work:( "Possible unintended reference comparison; to get a value comparison cast the left hand side to type 'string'"

        J E 2 Replies Last reply
        0
        • R Rmokkenstorm

          doesn't work:( "Possible unintended reference comparison; to get a value comparison cast the left hand side to type 'string'"

          J Offline
          J Offline
          J4amieC
          wrote on last edited by
          #4

          so what happens if you do what it says?

          Rmokkenstorm wrote:

          to get a value comparison cast the left hand side to type 'string'

          1 Reply Last reply
          0
          • R Rmokkenstorm

            doesn't work:( "Possible unintended reference comparison; to get a value comparison cast the left hand side to type 'string'"

            E Offline
            E Offline
            Eric Dahlvang
            wrote on last edited by
            #5

            if ((string)oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value != string.Empty) { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = txtBorgtochtNummer.Text; } else { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = "%"; } Eric Dahlvang-Programmer

            R 1 Reply Last reply
            0
            • E Eric Dahlvang

              if ((string)oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value != string.Empty) { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = txtBorgtochtNummer.Text; } else { oracleDataAdapter1.SelectCommand.Parameters[":PARAM2"].Value = "%"; } Eric Dahlvang-Programmer

              R Offline
              R Offline
              Rmokkenstorm
              wrote on last edited by
              #6

              Your my hero :-) Wanna be god? I have to press my button twice. I click once.. noting happens. I click twice he loads the data Then I enter other search values I click once he shows nothing I click twice he loads the date whit the new values

              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