Type of conditional expression cannot be determined because there is no implicit conversion between ” and ‘System.DateTime’

I had the error contained in the title where I was trying to assign a DateTime to an object property that could be nullable. If the value is not null I had to parse the value as a DateTime… The code is as following:

results.Add(new MyObject() {
    ID = new Guid(row["MyObjectID"].ToString()),
    Title = row["Title"].ToString(),
    DateDisabled = row.IsNull("DateDisabled") ? null

     : DateTime.Parse(row["DateDisabled"].ToString()),
});

The easiest way to solve this is as follows:

results.Add(new MyObject() {
    ID = new Guid(row["MyObjectID"].ToString()),
    Title = row["Title"].ToString(),
    DateDisabled = row.IsNull("DateDisabled") ? (DateTime?)null
     : DateTime.Parse(row["DateDisabled"].ToString()),
});

Very Simple MD5 File Hash Checker

You know those files that you download that have MD5 Hashes next to the download so that you can verify that you’ve got the correct, untampered-with version of the software that you are downloading…

I created a simple .NET tool to check the hash and the code is located here.

JQuery Visual Studio documentation only on Debug

I’ve included my scripts using a dynamic method that means Visual Studio can’t determine what scripts are available to a given page.

This removed the code completion for scripts, and I found the code completion helpful especially as I am learning JQuery and also due to the fact that you can never remember everything 🙂 I also wanted to prevent the script loading when

To get around this issue I’ve included the scripts like this

<% #if DEBUG %>
<!-- Load VS JQuery documentation if in debug mode! -->
<script src="../../Scripts/jquery-1.3.2-vsdoc.js" type="text/javascript"></script>
<% #endif %>

Which ensures that the Script include is only included in DEBUG builds… this means that when I would go to production that script would not be included in the page…

This doesn’t seem (at the moment) to cause issues with the real registration of JQuery… It’s not the most perfect, but it’s a safeguard  against me forgetting 🙂

Update: It’s actually not being found at runtime… So maybe that is why it is not causing issues 🙂