8.1.16

Heh

Second baby due May 24th - 36 years and a day after my own birth. Maths, motherfucker!

18.3.14

Checkboxlist no values

Can't compare values in a checkboxlist to those from a datasource / datatable?

Make sure the checkboxlist listitems actually have values first. They won't have values on page load - you might need to run your compare script under the DataBound event instead...

HTML:

<asp:CheckBoxList runat="server" ID="interest" OnDataBound="interest_databound" DataSourceID="dsInterest" DataTextField="InterestDescription" DataValueField="InterestID">
</asp:CheckBoxList>

Code-behind:

protected void interest_databound(object sender, EventArgs e) {
   int PersonID = 5;
   SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["db"].ConnectionString);
   SqlCommand cmd = new SqlCommand("SELECT PersonID, InterestID, InterestDescription FROM Table where PersonID = '" + PersonID + "'", con);
   con.Open();
   SqlDataReader dr = cmd.ExecuteReader();
   while (dr.Read()) {
      ListItem currentCheckBox = interest.Items.FindByValue(dr["InterestID"].ToString());
      if (currentCheckBox != null) {
         currentCheckBox.Selected = true;
      }
   }
   dr.Dispose();
   con.Dispose();
   cmd.Dispose();
}

17.8.12

Uh...


Where the fuck did the past six months go? 

Happy half birthday Grace, love you loads xxx

19.2.12

19.12.11

DO NOT ANGER CHRISTMAS SLUG




DO NOT ANGER CHRISTMAS SLUG

15.8.11

In case you hadn't heard...

February 16th 2012 is when our first baby is due. And stuff.