I've tried every diet too, and all of them worked for a few weeks, and just like you I would start gaining by the end of the first month. Sometimes because I already knew the diet well enough to cheat without technically "cheating" and other times because it simply was such a drastic change for me that I actually just got burnt out on it and blew it in an all out binge. I'm sure there have also been times that I started exercising at the same time I started dieting and didn't realize that by increasing my muscle tone I would actually be gaining weight because muscles are denser than fat.
Here's is what I suggest. For the next 3 days write down what you eat and when you eat it. Just track your intake, eat what you want and don't worry about any sort of diet. At the end of 3-4 days you should have some idea of your own eating habits and where the majority of your calories are coming from, carbs, proteins, fats and how many calories you're getting. So give all of that a look and pick a bad habit, maybe there is an afternoon snack that could use a healthier approach and work on fixing just that bad habit. Then go on to the next bad habit. So forth and so on until all your habits are good for you.
If you don't really find anything particularly bad in your habits, take a look at your nutritional levels, and see where you're low, then google foods with that nutrient and try to get more of them into your daily regimen.
Also you can do the same with your activities, track your burn and then start thinking of ways to get yourself moving more, because if you want to lose weight you have to burn more calories than you take in. You also need to take in a sufficient amount of protein in order to build muscle and you do want to build muscle because muscle burns fat! All the working out in the world won't get you into shape if you don't give your body the proper nutrients to actually build new muscle tissue. I look for a calorie pie that is roughly 40% carbs, 40% proteins and 20% fats, but everybody is different. You might find you lose weight more easily with a different breakdown, but you have to do a little experimentation in order to figure it out.
Starting weight: 244.6 lbs. 10/01/09
Pounds lost: 80.6 lbs
Current weight: 164 lbs
Goal weight: 120 lbs
Weight to go: 44 lbs
Goal Date: 1/1/13