Can't get a momentary switch to work

Hello,
I'm squeezing my brain over an apparently very simple project.
I just want to turn an LED when I press a momentary switch.
Here's the code. I'm also attaching a schematic and a picture.

int state = LOW;

void setup()
{
  Serial.begin(9600);
  pinMode(7, OUTPUT);
  pinMode(2, INPUT);
}
void loop()
{
  state = digitalRead(2);
digitalWrite(7, state);

Serial.println(state);
delay(100);
}

I already tried turning the switch in any direction, still no reaction.
If I replace the switch with a jumper cable, the LED turns on, as expected. So I guess the problem is actually the switch.
I tried all the switches I found in the starter kit, with no luck.

Can anybody please tell me if I'm doing something wrong?
Thanks in advance.

LSKA

http://www.jameco.com/Jameco/Products/ProdDS/153251%20Ver%20A.pdf

You are connected to the same connector on the switch... so it won't do anything when you press it. move the lower wires to the OTHER SIDE of the breadboard gap and try again.

pwillard:
http://www.jameco.com/Jameco/Products/ProdDS/153251%20Ver%20A.pdf

You are connected to the same connector on the switch... so it won't do anything when you press it. move the lower wires to the OTHER SIDE of the breadboard gap and try again.

Huh? Ever owned a tactile pushbutton switch? The diagram and photo are quite
correctly wired, the issue is that the pins of a tactile switch are not on a 0.1" pitch.

You have to force the push-button pins apart somewhat and push right down into
the breadboard to get contact, and it may be unreliable as the pins aren't long.

The switches I have use the short side connections, So it is wired correctly. However the pins are short and may not make good contact with the rails in the breadboard. The sketch looks OK. If you have a couple jumpers with female ends, try connecting them to the switch. Or maybe with alligator clips. If you have a VOM, test the switch. If not, wire the switch led and resister in series from +5 volts to ground, and test.

The resistor is connected to ground it should be connected to the 5v supply your wiring is in correct.

Also, remember switches have bounce that you have too deal with.

Thank you all, in fact it was as steinie44 stated: the switch's pins don't fit well on the breadboard. After a little fiddling, i was able to get it to work.
Now I'm dealing with debouncing, but this is another story!
thanks.

Use the internal Pull-up resistor built into the Arduino, that way you can get rid of the resistor as well. So much easier to write one line of code as opposed to connecting another physical component...