Arduino and BD710 Transistor...

unfortunately I still can't get it to work. As I don't have 220 ohm resistors I'm using a 330 resistor to the gate and the 47k to the ground. The transistor is a IRL 530N TO-220AB (datasheet). But I'm not sure how to read the datasheet properly to know which pin is which (at the moment I figured from left to right: 1 = Gate, 2 = source, 3 = drain). The diode is a Schottky Diode (60V 5A SB560). Here's an image of the setup:

Then I directly connect the solenoid with the 12v it works. Also if I change drain and source the solenoid gets powered but isn't controlled by the arduino (its like directly connected to the power).
Did i connect something wrong or might be something damaged already?

@cjdelphi: how do you mean changing the logic?