Intellisense Broken after LINQ installation in Visual Studio 2005

IT Chapters, Tip 4 Comments »

Yes, its a known issue!  I stumbled across this problem after installing LINQ a while back.  Luckily there is a fix for the problem.  Just follow the steps below in the order provided and Visual Studio will be back up and running as expected.

  1. Close Down Visual Studio
  2. Start Regedit
  3. Open the following key: HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\Packages\{A066E284–DCAB-11D2–B551–00C04F68D4DB}\SatelliteDLL
  4. Edit the “Path” value and change it from:
    “C:\Program Files\Microsoft Visual Studio 8\VC#\VCSPackages\1033\”
    to
    “C:\Program Files\Microsoft Visual Studio 8\VC#\VCSPackages\”
  5. Go to C:\Program Files\Microsoft Visual Studio 8\Common7\IDE and run the following commands in order:
  1. devenv /setup
  2. devenv /resetuserdata
  3. devenv /resetsettings CSharp

After this, restart Visual Studio.  Your intellisense and smart tags will now be working as expected.

Have fun!

 

Tip of the Day

IT Chapters, Tip No Comments »

Great tip from Scott Guthrie regarding adding new providers to your web.config in ASP.NET.

Common Gotcha Sorted!

And Now for Something Completely Different

Tip 1 Comment »

Something to keep you warm during those cold winter nights.

  • 1 part Pimms
  • 3 parts Apple Juice (the clear one, not the cloudy version)
  • Mix together
  • Heat gently until warm but do not boil (I’ve used the microwave as its easier, around 1 minute per glass)
  • Add orange or apple slices (I actually add orange before the heating part, it makes the taste so much better)
  • Serve warm.

I hope you enjoy that little recipe as its a favourite in my house.

SQL Server ORDER BY on Datetime without Time

IT Chapters, Tip No Comments »

Here is a small tip for SQL Server that I needed today.  We have a time based report of payments that we make for our clients.  This report is used to double check that all payments have been made and is required to be sorted by the date the payment was created and after that the client’s name.

However, on running the report we were getting weird orders in the query.  I tracked this down to the fact that we’re storing date and time for the date that the payment was created and our ORDER BY clause (ORDER BY DateCreated, Client.Fullname) meant that if the time changed, the ordering would restart for the Client.Fullname field.

So the obvious solution is to do an ORDER BY on the date portion only of the DateCreated field.  Since SQL Server stores the datetime records as 2 4 byte integers, we can do some math magic to strip the time.

The first 4 byte portion holds the days since the 1st of January 1900, with the second portion storing the number of milliseconds since midnight.  This means that we can simply convert the datetime field to a float value, run floor() which will strip the digits after the decimal point and then convert back into datetime.

Which works wonders.  Here is the SQL ORDER BY clause that we are now using in the system:

ORDER BY cast(floor(cast(DateCreated as float)) as datetime), Client.Fullname

Tip of the Day - Redirection in ASP.NET

Tip 1 Comment »

I was having a few problems redirecting users from a web form to the referrer that had taken them to this page.  The URL in Request.UrlReferrer was pointing to itself as I had already done a postback.  A little searching on Google brought up this little gem.  Thanks to Marco Bellinaso and Kevin Hoffman! :)


Private Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
If Not Page.IsPostBack Then
‘ Save the referrer Url
ViewState(”ReferrerUrl”) = Request.UrlReferrer.ToString()
End If
End Sub

Protected Sub SaveAndReturn_Click(ByVal sender As Object, ByVal e As EventArgs)
‘ do something here, e.g. add/update some DB records

‘ redirect to the previous page
Response.Redirect(ViewState(”ReferrerUrl”).ToString())
End Sub

Torrent Tip

Tip No Comments »

I download a fair amount of torrent data with my laptop. I try to support podcasters if they have torrent feeds by running my laptop as a seeder. I also download the Ubuntu torrents to use in my virtual machine as well as seeding for other people’s benefit.

There is a drawback to the use of torrents. Torrents are broken up into hundreds of pieces per download and downloaded as they become available. This creates a large amount of fragmentation on your disk and it becomes even worse if you are using your machine as the downloads run (which I do). The disk slowdown becomes increasingly noticeable especially when I am running my laptop as my development machine and compiling while these downloads run.

I did some investigating into this problem and I have found a great way to solve it. If your torrent client (in my case Azureus) has the option, check the box that allocates and zeroes the download when you start downloading. What this does is allocate file space on your machine in advance which means that the only fragmentation that is going to take place is in the actual file itself which you can fix with an application like contig.

Hope this tip helps! :)

Enclosure Tip for Podcasters!

Tip No Comments »

Here is a great tip for podcasters using Wordpress. To be listed in Audio.weblogs.com your RSS feed needs to have the enclosure tag inserted.

To make sure this happens, follow these steps.

1) Create a new wordpress category called “Podcasts” (or whatever you would like)

2) Make sure Permalinks are turned ON. I am using the default permalink structure for my example. Feel free to update yours with your preferences but make sure you change the link below properly.

3) Now use this link for your podcast feed: http://www.yourdomainhere.com/archives/category/podcasts/feed/
This creates a RSS2 feed exclusively for your podcast category. Simple as that, you can get your listeners to subscribe to this feed for only posts on your blog that contain enclosures.

There is a caveat to this though. Currently Wordpress 1.22 does not support enclosures. There is a hack available on the wordpress support site. Click here for the support page. Fortunately the CVS version does support enclosures but no word yet on when this will be released.

Enjoy, and I hope this helps.