Category: Code

Help! The indentation on my bullet points are wrong!

I was recently asked to help someone with some HTML. They said that the bullet points were indenting wrong.

If you look at the Results tab below first, you’ll see the difference. The top is what they had, the bottom is what they wanted.

My first thought, was that we’d need to adjust the CSS and fix/change the styling on the UL tag.

Then I saw the HTML. It was a simple change. Use proper HTML elements instead of P tags with special HTML entities and styling.

VOILA! Easy fix.

Learning SQL – A New Resource

I use SQL all the time at work. I’m a web developer (mostly using the IIS, ASP.Net and MS SQL tool chain).

Anytime I can learn some new SQL tricks or logic, I’m happy (well, actually, anytime I can learn anything, I’m happy… but that another post for another day).

I recently found out that Khan Academy has release a new SQL course.

It’s an expansion on their “Hour of SQL” they did back in December of 2014.

Enjoy!

Ektron upgrade from 8.6.1 to 9.1 “Reference.svcmap” error

I recently upgraded Ektron from v8.6.1 to v9.1 SP1. After the upgrade when I tried to view the website, or run the project in Visual Studio I got the following error:

Parser Error Message: Reference.svcmap: Could not load file or assembly 'Ektron.Cms.Contracts, Version=8.6.1.xx, Culture=neutral, PublicKeyToken=559a2c4fa21e63be' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

After much headache and many long emails back and forth with Ektron Support, I finally found an article that got me headed in the right direction.

Follow the link above for screenshots and details.

The basics are:

  1. Edit your Web Reference.
  2. Go into the Advanced tab.
  3. Clear the “Reuse types in referenced assemblies” checkbox and OK.

Converting to a specific timezone inside SSRS

In Microsoft Report Studio (SSRS), we needed to convert to a specific timezone, instead of the more common “Convert to Local Timezone”.

Here is how to do that.

First you MUST include a reference to System.Core.

Then, put this into an expression. The Fields!SomeDate.Value is my date field in SSRS.

'MUST ADD REFERENCE to System.Core

=System.TimeZoneInfo.ConvertTimeFromUtc(Fields!SomeDate.Value, System.TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time") )

VOILA! It now converts from the UTC date, to the Eastern Standard Time. There are many time zones you can choose from.

Are you running in the IDE?

Two methods, one for .NET (Visual Basic, but easily adjusted for C#) and the other for VB Classic (VB 5 and 6)

To check and see if the .NET code is running from the IDE:

More specifically, the .NET method checks to see if there is a debugger attached.  It is possible to attach a debugger to a compiled exe, so this would return True.

<code>
  If System.Diagnostics.Debugger.IsAttached Then
    ‘This is a way to see if we are running in the IDE. 

  End If
</code>

And, if you’re using VB Classic, you can use this:

<code>
‘Since Debug commands are compiled OUT, this will never return an error
‘when the code is compiled.
Private Function IsDebugMode as Boolean
  On Error Resume Next
  Debug.Assert 1/0
  IsDebugMode = (Err.Number <> 0)
  On Error Goto 0
End Function
</code>

Powered by WordPress & Theme by Anders Norén