Community Blogs

Browse by Tags

Related Posts

  • Sync your Visual Studio settings with Live Mesh!

    Did you know that you can use Live Mesh to share and sync your Visual Studio settings between computers ? Here is how to do this in Vista (with Live Mesh client installed): Go to your VS2008 folder (usually C:\Users\ YourUserName \Documents\Visual Studio 2008), right-click on Settings folder and select “Add folder to your Live Mesh…”   On each of your Mesh Windows devices you’ll end up with a Settings shortcut on the desktop (Mesh folders are not sync by default). Double-click the shortcut to set your local VS settings folder (usually C:\Users\ YourUserName \Documents\Visual Studio 2008\Settings). The “Show synchronization options” allows you to define sync rules for each device.   Pros: Automatically sync your VS settings between...


  • Permission problem while trying to move/delete/rename folder in Vista ?

    I get this issue everyday in Vista: I try to move/delete/rename folders and get a “you need permission to perform this action” error. Note these are not system folders, just some personal folders, and this is not related to UAC or drive hardware. I have this issue regardless which account I use (User or Administrator). At first you may want to look in the security tab and give full control permission to everyone… but that does not solve the problem! (and this is a bad practice)   If you experience the same, here is what you can do to get elevated privilege to perform your action: !!Very Important: First you must close all opened explorer windows!! Click on the Windows “start” orb and type “ explorer ”.   In the results pane right-click...


  • AJAX Tip: Don't forget about the Async Web Service Calls!

    FireFox. Internet Explorer 8. Both have great JavaScript debugging tools. Thanks to those tools, I only spent 5 minutes on an issue that could have taken hours to figure out. It was one of those moments when you know its something simple but you can't figure out what it is. I had a page that loaded web service data into an AjaxDataControl Repeater. After the web service call, I entered some JavaScript to grab a page parameter and choose the item on the page that was selected. When I ran the page, I received an error that the object was undefined. However, if I added an alert to check the parameter, the page loaded fine. After using one of the debug tools I saw that the data wasn't populated yet. That's because ASP.NET AJAX makes...


  • Performance Tip: Return Only Necessary Columns Using LINQ

    I was running into an issue where one of my webmethods was taking a large amount of time to return a small set (5-10 objects). I was using LINQ to SQL. I noticed that the LINQ to SQL query was returning all of the rows. After looking into the table a bit further, I noticed that the table included some columns with a larger type (old text column, image column, etc). So, I decided to modify my select to contain just the columns I needed. It improved my response time from roughly 8 seconds to 250 milliseconds. Here's a sample select statement: From t In db.News _ Where t.NewsID = NewsID _ Select New With {.Title = t.Title, .Abstract = t.Abstract, .DatePublished = t.DatePublished) Instead of enumerating these items as type NewsPosting, I had...


  • Adding QueryString Parameters to the SiteMapNode

    There is no way to add querystring parameters to the SiteMapNode in a SiteMap control "out of the box." I'm quite surprised there is no option but luckily the SiteMap uses the provider model. After a Live search, I was able to find a solution provided by Bobby DeRosa . By creating a custom provider, this can be accomplished. The project I was on is an update of an ASP.net app written in VB.net so here is my VB.net port: Imports System.Collections.Specialized Imports System.Web Namespace Configuration Public Class ExtendedSiteMapProvider Inherits XmlSiteMapProvider Public Overrides Sub Initialize( ByVal name As String , ByVal attributes As NameValueCollection) MyBase .Initialize(name, attributes) Dim resolveHandler As New SiteMapResolveEventHandler...


  • Retrieving SQL Type Image Using LINQ

    LINQ views the Image type in SQL Server as Binary. So, there are a few options that we have. We can either (a) modify our LINQ to SQL class and change the property to Byte() instead of Binary or we can (b) convert the Binary to an array. To do the latter, you can use a lambda expression to obtain the image you are looking for and grabbing just the image. Here's an example: MySqlContext.Photos.Single( Function (p) p.PhotoID = PhotoID).OriginalBytes.ToArray The above assumes that we have a table called Photos that contains a column called PhotoID. We'll filter the PhotoID (p.PhotoID) based on our variable PhotoID. Then, we'll return the Byte Array of the OriginalBytes column to display our image. Read More...


  • Force Your Web Site To Be IE7 Compatible

    Microsoft recognizes that it will be difficult to have all sites use the latest HTML and CSS specs that are found in IE8. To accommodate the web sites that cannot be converted at this time, they've created a work around. There are two options: a) you can modify the config in IIS 7 or b) you can add a new meta tag to your page headers. More information about this can be found by visiting http://support.microsoft.com/kb/952030 . Read More...


  • Pimp my IDE talk at EnergizeIT

    Here is a link to download the content I used for my quick talk at EnergizeIT Toronto ("Pimp my IDE" aka customize Visual Studio 2008): The blog post I showed: http://www.hanselman.com/blog/VisualStudioProgrammerThemesGallery.aspx You can also check this one: http://idehotornot.ning.com/ Read More...


  • Including JS file references in masterpages

      One of the issues I have faced with including site-wide JS files while developing web-applications is the simple fact that I was developing in Windows XP and IIS 5. And IIS puts in each of my websites as virtual-directories. So , I always have trouble including references to js files from the master-pages. One alternative was to have a virtual directory outside the project structure and point it to the js folder, and my references would work properly. But there are other nicer ways to do the...( read more ) Read More...


  • Aggregate Functions in LINQ

    I found a great post which summarizes aggregate functions in LINQ. It includes examples for Average, Sum, and Count. Check it out at http://www.dev102.com/2008/04/16/how-to-use-aggregate-functions-with-linq-to-sql/ . As always, you can test your functions by using LINQPad which is available at http://www.linqpad.net/ . Read More...


Page 1 of 11 (109 items) 1 2 3 4 5 Next > ... Last »