Archive for the 'Coding' Category

Disable jScript Intellisense

From the Visual Studio menu select:

Tools -> Options -> Text Editor -> JScript

Then uncheck Auto List Members and Parameter Information.

Also, uncheck options under Miscellaneous - Show Syntax errors

How to add locations to Open File dialog in SSMS

Add subkeys Place0,Place1,etc

Under each subkey add two REG_SZ values

Name = “Shortcut Name”
Path = “Folder location”

HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\Open Find\Places\UserDefinedPlaces

Download vsto through clickonce install

I was getting this error while trying to deploy an excel-add-in through clickonce.

URLDownloadToCacheFile failed with HRESULT ‘-2146697210′

Error: An error occurred trying to download ‘http://###/ExcelAddIn.vsto’.

Simple fix - add .vsto –> application/x-ms-vsto to the MIME type in IIS.

Label not displaying ampersand

Kind of a weird one - Ampersands disappear in labels, unless you set the UseMnemonic property to false.

Terminal Server

If you have reached the two connection limit for Terminal Services, you can disconnect one of the sessions by using the console session.

To use the console session, click on Start, Run and enter “mstsc /admin”, then click on OK. This will open the RDP window and you can connect normally from there.

VB vs C#

As a 15+ year VB coder, I found this podcast to be pretty enlightening about the future of VB along with some myth busting.

Does VB have a future

Install IE6 on Vista/Windows 7

If you need to test sites for IE 6 compatibility, it is hard to beat Virtual PC. These images expire after a while, but MS has been posting updates.

IE 6 image

Center datagrid pager style in IE8


<PagerStyle HorizontalAlign="Center" />

stopped working in IE8. Updated the css to the following and everything centered fine.


.dgrGridpager table
{
margin: 0 auto 2px auto;
}

sp_configure and Ole Automation Procedures

I needed to allow access to file create and delete to a specific user in sql server 2008. This advanced option is now disabled by default.

To enable:

sp_configure ’show advanced options’, 1;
GO
RECONFIGURE;
GO
sp_configure ‘Ole Automation Procedures’, 1;
GO
RECONFIGURE;
GO

Hide horizontal scrollbar in tablelayoutpanel

When populating a tablelayoutpanel dynamically, the horizontal scrollbar kept appearing, even though there was no need for it.

It looks like there is no property to disable only the horizontal scrollbar, but I did find this workaround.

Pad the layoutpanel to the width of the horizontal scroll bar and the scroll bar will disappear.


int vertScrollWidth = SystemInformation.VerticalScrollBarWidth;

tableLayoutPanel1.Padding = new Padding(0, 0, vertScrollWidth, 0);

Next Page »