May 1
Bloody diets
icon1 sam sinfield | icon2 Diet | icon4 05 1st, 2007| icon34 Comments »

I seem to spend most of my life on one kind of diet or another and never seem to lose any weight.

‘Eat less, exercise more’ is what the general consensus seems to be. I’ve been trying this for the last few weeks and am yet to lose weight. I go to the gym for an hour and a half every other day and work really hard and also go jogging for at least half an hour every other day. I’m down to a calorie count of about 700/day. I would have thought it a physical impossibility, but I’ve only lost about 1 pound!! I’ve tried just about every diet and am yet to find one that really works.

The next one I’m going to try is the lemonade diet. This is a temporary ‘fast’ over about 10 days. I’m still waiting for the book (another bloody book!) to arrive in the post but it basically looks like you just live off mineral water and fresh lemon juice, cayenne peppers(???) and some kind of laxative tea. Sounds repulsive and no doubt I’ll starve but this is apparently the diet that Beyonce went on for 2 weeks and lost 22lbs!! I’ll try it for 10 days, the only problem is fitting the fast into my life so I don’t miss out on my valuable weekend time off from the kids when I have to go out and get drunk.

I’ve got half a weekend off this weekend and a whole weekend off next weekend so the fast will have to wait until after then. I’ll post before and after weights but there is no way I’m posting before and after photos, not having my flab shown on t’internet.

Apr 11

I’ve been really slow in making a first post but I thought I would post this code snippet as it seems to be something I’m using quite a lot at the moment. It is for building xml from a database:

System.Xml.XmlDocument xmldoc = new System.Xml.XmlDocument();
xmldoc.LoadXml("");
System.Xml.XmlElement root = xmldoc.DocumentElement;
try
{
SqlConnection conn = new SqlConnection(connectionstring);
conn.Open();
SqlCommand cmd = conn.CreateCommand();
cmd.CommandType = CommandType.Text;
cmd.CommandText = sqlSelectStatement;
using (SqlDataReader dr = cmd.ExecuteReader())
{
// Process rows
while (dr.Read())
{
System.Xml.XmlElement row = xmldoc.CreateElement("row");
for(int i=0;i
{
System.Xml.XmlElement el = xmldoc.CreateElement(dr.GetName(i));
if(!dr.IsDBNull(i))
{
el.InnerText = dr.GetValue(i).ToString();
}
row.AppendChild(el);
}
root.AppendChild(row);
}
}
conn.Close();
}
catch(){}

There is another way of doing it directly into xml using cmd.ExecuteXmlReader and putting ” for xml auto” on the end of your sql select statement but apparently this only works in sqlserver 200 or higher and it puts all the fields as attributes of a node with the name of the table and no root node which I didn’t like, personal choice.

I’m sure this has its problems, let me know you think

Next Entries »