Adsense
Wednesday, May 27, 2009
‘The configuration section 'connectionStrings' cannot be read because it is missing a section declaration’ message in IIS7
The ONLY reference to this error that I could find was from MSDN HERE. No sections of the web.config were encrypted so, none of the recommended causes and resolutions helped.The web.config file for the 3rd party project was pretty large and I thought it might have been due to mal-formed xml somewhere. I validated the xml and scanned for anything obvious, but it all looked like everything was fine.
I eventually tracked down the problem with the web.config file. The problem was in the <configSections> section of the web.config. The 1st line within this section was <clear/>. The <clear/> tag can be used to removes all sections and section groups that were already defined (either earlier in the given configuration file or higher in the configuration hierarchy.) This is helpful in other sections when you want to clear a default provider before registering a new one, etc…
It looks like <clear/> is a valid tag for this section, so I’m not sure why it would be causing the error. Either way it solved my problem for my development environment. Hope this helps someone else in the future.
~ Paul
Tuesday, May 26, 2009
How to Import your Delicious Bookmarks into Google Bookmarks
Other than my development tools, the only other Add-on that I really miss is my trusty Del.icio.us Bookmark bar. It is great to have immediate access to my bookmarks in Firefox with tag support. To help remedy this situation I started to look at what options I have for accessing my Del.icio.us bookmarks from Chrome. You can do the obvious and just access them from http://delicious.com/, but that’s boring.
The 2nd option is to use bookmarklets. You can add these to any browser and they are basically bookmarks that give you access to your bookmarks. Not as good as a direct bookmark bar, but better than browsing there yourself 100 times a day. You can even get delicious bookmarklets that make it easy to pop-up the “Save bookmark” screen for the current page you’re on to add new bookmarks. Read about delicious bookmarklets..
The 3rd option (and the one I’m actually trying out.) Convert to Google Bookmarks. Unlike delicious, google bookmarks keeps your bookmarks private and makes them and their contents searchable. You can manage your bookmarks from the site or using Google toolbar. You can also manage them in Firefox using Add-ons. For users of iGoogle (Google’s home/startup pages), you can also get a Google Bookmarks Gadget that lets you interact with your bookmarks.
The next question is how to get ALL of your precious bookmarks out of Del.icio.us and into Google Bookmarks. Well, that’s easier than you might think. Mihai Parparita from Google has created a script that will import all of your Delicious bookmarks into Google Bookmarks automatically. You can perform the import at http://persistent.info/delicious2google or read more on their site..
You can also use a Google Bookmarks bookmarklet.
Does anyone else have a better solution for managing and accessing your bookmarks from Chrome?
Monday, December 22, 2008
Databinding an asp:ListBox has no selected items (selected = false)
If you are working with a Data Bound ASP.Net ListBox control (or a similar control) and are having trouble with all of your ListItem.Selected calls are returning false even though you KNOW you selected one or more of them. You might have an issue with the way you're Data Binding.
Consider the following code. In my example I am using a DataBindControls method that will retrieve some data and then bind it to a ListBox.
private void DataBindControls() {
ArrayList roles = RoleProvider.Instance().GetRoles();
lbRoles.DataSource = roles;
lbRoles.DataTextField = "RoleName";
lbRoles.DataValueField = "RoleId";
lbRoles.DataBind();
}
I just so happen to be calling this method in the Page_Load even of my page. Unfortunately, I forgot to wrap this call in a "IsPostBack" check. What is happening is that my control is being databound again before I access the selected values from the previous request.
protected void Page_Load(object sender, EventArgs e) {
DataBindControls();
}
You can easily remedy this issue by wrapping the call in an if statement that makes sure to only databind your controls on the initial call to the page. (when it's not a post back)
protected void Page_Load(object sender, EventArgs e) {
if (!IsPostBack) {
DataBindControls();
}
}
Just another one of those "Palm to Forhead" issues. Hope it helps someone. =)
Tuesday, October 14, 2008
Internet Explorer 6 (IE6) has extra white space gap after a empty, fixed size div with a background-image
I was trying to fix a small display issue with one of our pages in IE6. I had an unordered list that we set the background color on and wanted to add rounded images to the top and bottom to give it a nice look.
The rounded top image
The HTML
<div class="container">
<div style="height: 6px; width: 190px; background-image: url(../images/top.gif); background-repeat: no-repeat;">
</div>
<ul style="background-color:#763000;">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
<div style="height: 6px; width: 190px; background-image: url(../images/bottom.gif); background-repeat: no-repeat;">
</div>
</div>
Simple enough. Everything works great in IE7, Firefox, Chrome, etc... I get a report of extra white space after the top rounded image. I track down a system running Windows XP with IE6 and I fire it up. Sure enough, a bit of white space after the top div. But why....
The Problem
I tried everything that seemed to make sense. Checked margins, padding, etc... Everything was either good or changing it did nothing. Unfortunately in IE6 I didn't have access to my favorite tools like Firebug, so it was even more frustrating. Eventually I figured it out and I think I know what's going on.
IE6 assumes a font-size of 20px. Since my background-image was only 6px in height, when I set the height on the div it was ignored. The div would try to shrink to my set height, but would end up limited by the assumed font-size of 20px. By setting the font-size to something smaller in height than my desired 6px, it would solve the problem. Remember this when dealing with empty divs IE6. Hope it helps someone.
The HTML that works
By setting the font-size style in the "empty" div, IE6 allows the div to shrink to my desired height of 6px.
<div class="container">
<div style="height: 6px; font-size:0em; width: 190px; background-image: url(../images/top.gif); background-repeat: no-repeat;">
</div>
<ul style="background-color:#763000;">
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
<div style="height: 6px; font-size:0em; width: 190px; background-image: url(../images/bottom.gif); background-repeat: no-repeat;">
</div>
</div>
Google's Chrome displays saved passwords in plain text
Google's new web browser "Chrome" is pretty nice. I used it for a full day and found quite a few things that I really liked about it. As soon as the few plug-ins that I use daily get equivalents in Chrome, I will possibly use it for every day use. I was sad to learn that one of my biggest web browser pet-peeves is present in Chrome, and it seems to be an even worse implementation of it than Firefox 3's (Firefox 3 Saved Password Security.)
The Saved Password feature of any browser can be invaluable. It saves a great deal of time for passwords that you would otherwise have to enter many times a day. Unfortunately, most web browser make it WAY too easy to gain access to the web site URL, username and plain-text passwords to your accounts. Someone with only a few minutes access to your machine can easily gain access to this information.
In Google's Chrome, all someone (with several seconds alone with your computer) needs to do to steal your information is...
- Open Chrome
- Click customize(the wrench)
- Select Option
- Click the Minor Tweaks tab
- Click Show saved passwords
- Select one of your "secure" sites
- Click Show password
BAM! Someone just stole the web site address, username and password to one of your accounts? I hope it wasn't something important... In Firefox's defense, at least they have a "Master Password" that will require you to enter a password prior to them showing your passwords in plain-text. But no such feature is present in Chrome.
I'm always blown away by people's responses to this problem. People that I show in person are usually shocked when we're both staring at their bank account password in plain-text right before their eyes. People online usually say that no one ever has access to their computer, so their safe, or that they always lock their system when they're away. That's a great practice to get into, but I know the vast majority of users aren't so diligent.
At the very least, the Chrome team needs to add a master password for an added layer of security. I think both Firefox and Chrome should warn the user about this danger and prompt them to setup a master password by default, rather than having saved passwords turned on by default.
Tuesday, September 09, 2008
Reporting Services is grayed out after adding reporting services to an existing MS SQL install
You can add Reporting Services to an existing install of MS SQL in Windows Vista (not sure how different the step would be in XP) by following these steps.
- Open Programs and Features (press the windows key, type in Programs and Features and press enter)
- Right-Clicking on Microsoft SQL Server 2005 and click Change.
- Under SQL Server 2005 instances: select the instance you want to add reporting services to and click Next
- Click on To install a new component, click here
- Browse to the Setup.exe file on your installation disk and click OK
- Click through the wizard until you get to the Components to Install screen
- Select Reporting Services and finish the wizard.
It's that simple... Unless Reporting Services happens to be Grayed Out. If this is the case for you, you are probably missing requirements that Reporting Services needs. During the above process, you came to a screen called System Configuration Check and you probably got a yellow exclamation point on IIS Feature Requirements. Basically, you need to add some features to your IIS installation before you can install reporting services.
To enable these IIS features, follow the steps below.
- Open Programs and Features (press the windows key, type in Programs and Features and press enter)
- Click on Turn Windows features on or off to bring up the Windows Features window
- Expand the Internet Information Services option and place check marks next to all the features you want to install
- Click OK to install the features.
Here is a list of features that are required before you can add Reporting Services to your existing MS SQL Server installation. (Reference here.)
| Component | Folder |
|---|---|
| Static Content | Common HTTP Features |
| Default Document | Common HTTP Features |
| HTTP Redirection | Common HTTP Features |
| ASP.Net | Application Development |
| ISAPI Extension | Application Development |
| ISAPI Filters | Application Development |
| Windows Authentication | Security |
| IIS Metabase | Management Tools |
| IIS 6 WMI | Management Tools |
After adding these features, try to perform the steps above for adding Reporting Services to an existing MS SQL Installation and Reporting Services should not be grayed out. Hope this helps.
Tuesday, August 19, 2008
How to Enable/Disabled Recording Devices in Windows Vista
I had some strange sounds coming over my speakers and thought it might be one of my recording devices (my built in mic, etc) acting up. To troubleshoot this I brought up the Sound window, clicked on the Recording Tab and right-clicked on each of my recording devices to disable them. It turns out my problem was caused by something else and was easily fixed, but now I have a new issue. How to I enable my recording devices. If you check the Recording Tab in the Sound window, there are no devices listed. Maybe I can enable them directly from the Device Manager. Nope, nothing listed there either...
The solution is fairly simple, but seems to be completely non-standard for windows. Go back to the Recording Tab in the Sound window and right-click in the now blank tab. You should get a context menu that has two options (Show Disabled Devices and Show Disconnected Devices.) Click on Show Disabled Devices and you should now be able to see and enable your devices.
Not a huge issue, but fairly annoying since it is done differently than most other places in Windows (i.e. The network device screen. Disabled devices are still visible but are disabled...)
Monday, August 11, 2008
How to Replace/Remove Blank/Empty Lines in Visual Studio using Regular Expressions
If you want to remove or replace the Empty Lines in a Visual Studio file, you can perform the following.
- Press Control + H on your keyboard to bring up the replace window.
- In the Find What: field, enter ^$\n
- In the Replace With: field, enter nothing
- Check the Use: checkbox and then select Regular Expressions from the drop-down
- Click Replace All
Hope this helped. =)
Thursday, July 10, 2008
Firefox shows saved passwords in plain text!
I finally got around to updating to Firefox 3 yesterday. With all the new features being touted around the web, I was hoping that they would have gotten around to addressing my biggest pet-peeve with the browser. It seems that they didn't! You can read my original post about this issue HERE. Firefox 2 - Saved Password Security.
I'm sure you are diligent about security. Every time you get up to take a walk, hit the restroom or refill your <Insert the caffeinated beverage of your choice>, you always hit [Windows + L] to lock windows. You then leave your system, secure in the knowledge that all your secrets are safe and secure while you're away. What's that?!? You NEVER lock your computer when away from it...? If this is you, and you use Firefox as your main browser, this post might be of great interest.
When you install Firefox and log into a web site, such as MySpace, you might get a popup asking if you would like Firefox to save your password for you. What a great idea. If I let Firefox remember my passwords, I wont have to remember and enter them every time I visit a site. Handy! Better yet, this feature is turned on by default. Thanks Firefox. I, like most of you, probably just assume that my passwords are being handled securely and continue using Firefox for months adding more and more passwords to Firefox for my favorite sites as I go.
How secure are my saved passwords in Firefox 3?
In Firefox 3, it looks something like this.
You try to sign into your favorite Social Network. MySpace in this case.
Firefox is so helpful. Sure! Remember my MySpace password.
What exactly happens with my MySpace passwords in Firefox 3? They're secure, right? You can click [Tools > Options > Security (Tab) > Saved Passwords] to find out.
Well, Well. What do we have here? The URL to the web site and my username. Seems harmless enough. But what's this? A [Show Passwords] button? Lets click it and see what happens...
Gulp. There it is. Everything that someone would need to log into my MySpace account. The site address, my username, and my password in PLAIN TEXT! Anyone with about 20 seconds alone with your computer could easily get this information for themselves.
Try it for yourself and see just how scary it is when you see all the passwords for your banking accounts, your E-Trade account, etc. Better yet, walk your friends and co-workers through this on their own workstations and see the shock on their faces when they see their PLAIN TEXT passwords visible to the world in 3 easy steps that take 10 seconds to perform. I've gotten some pretty startled expressions showing people this.
I definitely think that Firefox should have the Master Password functionality enabled by default and should show the user a warning the first time they try to save a password. It seems like such an innocent thing, but having access to passwords in Plain Text is bad in my opinion.
How to protect yourself
Option 1. Turn off the "Remember passwords for sites" feature on the Tools > Options > Security Tab
Option 2. You can actually protect yourself from this flaw pretty easily, but it makes the feature a tad-bit more annoying. There is a "Use a master password" checkbox on the Security Tab too. If you check this box, you will be required to supply a password to be able to view saved passwords, or before you can use them to log into any web sites. Definitely worth it in my opinion even if the chance of someone having access to your workstation is slim.
Option 3. You should really consider locking your workstation when you are away from it anyway. If this isn't a habit that you already have, its really not that hard to start now. Just press the [Windows Key + L] to lock windows before you leave your computer.
Disclaimer
I'm always torn about writing about this kind of thing. Most of you will use the information to protect yourself, your friends and your co-workers. If nothing else, I've always felt that it is better to be aware of something even if a small percentage of people will use it negatively. For those of you thinking of using this to STEAL other people's passwords. Shame On You!
Just to save you a few seconds of attempting to log into my MySpace account. The email address, user names and passwords in the screen shots above have been altered to protect the innocent. =)
Monday, June 02, 2008
MSDTC on server 'SERVER NAME' is unavailable
You might encounter this error when trying to interact with a Microsoft SQL Server whose hosting environment doesn't have the Distributed Transaction Coordinator service turned on. To correct this problem, turn on the Distributed Transaction Coordinator service on the server hosting your SQL Server instance using the following steps.
- Press your 'Windows Key + R' to bring up the run window
- Enter 'Services.msc' in the run box and press ENTER
- Look for the service named 'Distributed Transaction Coordinator' and right click on it.
- Click on 'Start'
The service should now be started, and if the SQL Gods smile upon you, your error should be gone.
Tuesday, May 27, 2008
How to Sort a generic IList or List
To sort a generic List<T>, you can create a class that implements IComparer<T> and tells the list how to sort itself. Its fairly straight forward and the example below shows how to sort Widgets.
A Widget is a simple class that has a public string Name and a public int Size. I want to be able to sort generic lists of widgets (List<Widget>) by name and by size. You can see my code below.
The widget and sorter implementations
public class Widget { public string Name = string.Empty; public int Size = 0; public Widget(string name, int size) { this.Name = name; this.Size = size; } } public class WidgetNameSorter : IComparer<Widget> { public int Compare(Widget x, Widget y) { return x.Name.CompareTo(y.Name); } } public class WidgetSizeSorter : IComparer<Widget> { public int Compare(Widget x, Widget y) { return x.Size.CompareTo(y.Size); } }And application to create the list and sort it
class Program { static void Main(string[] args) { List<Widget> widgets = new List<Widget>(); widgets.Add(new Widget("Zeta", 6)); widgets.Add(new Widget("Beta", 3)); widgets.Add(new Widget("Alpha", 9)); OutputWidgets(widgets); widgets.Sort(new WidgetNameSorter()); OutputWidgets(widgets); widgets.Sort(new WidgetSizeSorter()); OutputWidgets(widgets); Console.ReadLine(); } public static void OutputWidgets(List<Widget> widgets) { foreach (Widget w in widgets) { Console.WriteLine(string.Format("{0} - {1}", w.Name, w.Size)); } Console.WriteLine(string.Empty); } }Running the application above results in the following output.
Straight forward enough? =)
So what do you do if you have a generic IList<T> and want to sort it? Since you only have the interface reference that can't make assumptions about what's implementing it, you have no Sort method. You can use the ToList() method to convert the IList<T> into a List<T>, and then call the Sort() method. See the updated example below. (Note: I previously blogged about a way to sort a generic IList using the ArrayList.Adapter. You can read about it HERE.)
class Program { static void Main(string[] args) { IList<Widget> widgets = new List<Widget>(); widgets.Add(new Widget("Zeta", 6)); widgets.Add(new Widget("Beta", 3)); widgets.Add(new Widget("Alpha", 9)); OutputWidgets(widgets); widgets.ToList().Sort(new WidgetNameSorter()); OutputWidgets(widgets); widgets.ToList().Sort(new WidgetSizeSorter()); OutputWidgets(widgets); Console.ReadLine(); } public static void OutputWidgets(IList<Widget> widgets) { OutputWidgets(widgets.ToList()); } public static void OutputWidgets(List<Widget> widgets) { foreach (Widget w in widgets) { Console.WriteLine(string.Format("{0} - {1}", w.Name, w.Size)); } Console.WriteLine(string.Empty); } }
Saturday, March 08, 2008
How To Fix Dead/Stuck Pixels on a Playstation Portable (PSP)
So, I broke down and bought a Playstation Portable (PSP) this weekend. Lo and behold, it has a single stuck pixel. I didn't even notice it until I fired up a game for the first time, but there it is... A little, constantly red, annoying little bastard!
I really hate confronting retailers with returns, especially when its a single pixel that I'm complaining about. This wouldn't be the first time that I've done it though. But before I packed the PSP back up and headed for Best Buy, I figured I'd check online to see if this was a common problem. Unfortunately, it is a very common problem with PSPs and many people that have exchanged a PSP due to dead pixels, reports that their new unit has even more. So I count myself somewhat lucky to only have a single stuck pixel.
Luckily, I happened upon a post that talked about a little movie that that was originally distributed to help fix dead/stuck pixels on LCD TVs and monitors. The video is a series of screen that flash repeatedly in each of the colors that a pixel supports (Red, Greed, Blue.) The idea being that you can coax a stubbornly stuck pixel into working (or raise a dead pixel from the grave) by constantly forcing all of the pixels of the display to cycle through all of their possible states. (great idea!)
(Note: A stuck pixel is a pixel that only displays a single color (red in my case) and doesn't cycle to any other color. A dead pixel is a pixel that is black and never displays a color. The success rate seems to be higher with stuck pixels over dead ones.)
I downloaded the PSP version and have it currently running on my PSP, but some people have reported success in minutes, while other have had to let the video run for several hours. The consensus seems to be, that if the video doesn't fix your stuck/dead pixel in 24 hours, you might just be stuck with it.
I post this here, because I know of a lot of people that have stuck/dead pixels on their LCD monitors or laptop screen, and I figure that this might be worth a try on those as well. I'll post a follow up and let everyone know how it worked on my PSP. =)
You can download the movie file here, and read about it here.
Good luck and let me know if it works for you (especially when not used on a PSP.)
UPDATE
Well, I ran the video for probably 7 hours on my new PSP with no luck. The red little bastard pixel remained. Luckily, Best Buy was great at letting me return my unit for a new one. And I haven't been able to find any other stuck/dead pixels.
Hope you have better luck.
Thursday, March 06, 2008
'Logon failure: unknown user name or bad password.' message in Windows Vista on a Dell D830 with a Fingerprint Scanner and Embassy Security Center. Bl
I received a new laptop for work (a Dell D830) and had a fairly easy time getting it setup for development. To my dismay, I notice periodic Blue Screens of Death (BSOD) while booting into Windows Vista. I looked up the error codes and was unable to find a cause and since my system always seemed to boot normally the next time.
Talking with a co-worker of mine that got a new laptop when I did, we both experienced seemingly random BSODs and were always a bit suspect of the Fingerprint scanner. I didn't really worry about it too much. That is, until this morning.
While booting this morning, I got another BSOD. When my system booted again, I was unable to logon to Windows Vista. Every time I would put in my username and password I would get the following error message.
"Logon failure: unknown user name or bad password."
I also noticed that I wasn't given the option to use my D830's Fingerprint scanner to logon either. I tried logging onto domain accounts and local account with no luck. I rebooted multiple times. I used Vistas startup repair tool with no luck. It was looking like I might have to hit a restore point or restore an image of my laptop.
Luckily for me, my boss had experienced a similar issue. The fix is a mixture of disabling your Fingerprint scanner and Dell's Embassy Security Center. The first step is to boot into Safe Mode by pressing F8 before windows boots and selecting it from the boot menu. You should be able to logon to windows in safe mode (if not, you might have a different issue.) Once you are logged on, perform the following.
Disable the Fingerprint scanner
(this step might be optional, since the second step might do it automatically.)
- Press your Windows Key and type "Device Manager" and hit Enter to bring up the device manager.
- Under Biometrics, right click on your fingerprint scanner and select Disable
- Close the device manager
Turn off Secure Windows Login in Embassy Security Center
- Press your Windows Key and type "Embassy Security Center" and press Enter (if you don't have this application, you probably have a different issue going on.)
- Click on Windows Logon
- Uncheck Enable Secure Windows Logon
- Click Apply and close Embassy Security Center
After performing these steps, reboot your machine normally and try to login again. Worked great for us on our Dell D830 and was a bit of a pain to track down. I might post an update and let you know if this also clears up my random BSODs.
Hope this helps someone. =)
Wednesday, February 27, 2008
How To safely shutdown and restart Windows Explorer (Explorer.exe) in Windows Vista
There are few things more frustrating than having Windows Explorer (Explorer.exe) FUBAR while you're working or playing in windows (not to mention when it crashes completely and unexpectedly.) If you ever find yourself in a situation where you want to restart the explorer process, you can follow these steps to restart it in a safe manner.
Step 1. Shutdown Windows Explorer
- Click on the start button
- Press and hold Ctrl+Shift then Right-Click on a blank spot on the start menu
- You should see the following dialog. Click on Exit Explorer
Step 2. Restart Windows Explorer
- Open the task manager by pressing the ctrl+shift+esc keys
- Click on File > New Task(Run)
- Enter Explorer next to Open: and press Enter
This process will safely shutdown and then restart the Windows Explorer process.
Wednesday, January 30, 2008
Samsung Blackjack - Windows Mobile 6 - FINALLY!
I clearly remember the salesman telling me that I should be able to download and install Windows Mobile 6 "AS SOON AS ITS RELEASED" onto my sleek new Blackjack last fall when I purchased it. After many months, a million false alarms, several leaked versions of WM6, I finally have an official version installed on my Blackjack.
Get the OFFICIAL release from Samsung below, and Enjoy!
Get Windows Mobile 6 for your Black Jack!
Detailed Update Information
- Microsoft Windows Mobile 6.0
- Microsoft Office Mobile (allows you to view & edit XLS and DOC files on the fly)
- Video Share Calling Technology (allows you with supported plan and devices, to transmit live or recorded video to a recipient)
- TeleNav & MobiTV capable
- Modified UI with updated text & icons in several areas
- Enhancements to improve call quality
- Fixed, Contact lookup doesn’t work when saving embedded SMS phone number
- Fixed, Several Bluetooth issues
- Fixed, VCML count not displayed properly
- Fixed, Media player issue
- Fixed, Embedded URL in MMS could not be saved
- Fixed, CV does not play in full screen mode
- Fixed, Converter for currency now supports Canada
- Fixed, Handset would sound tone when charger was inserted in Silent Mode
- Integrated Daylight Savings Time Patch
- Enhanced international roaming support (originally included in GB4 S/W)
Monday, January 21, 2008
"Error: SQL Server does not exist or access denied" - SQL Server 2005 - .Net 1.1 - Specifying ip,port
I recently picked up a project that was written using Visual Studio 2003 and .Net 1.1. The application connects to a SQL Server 2005 database, and I didn't have the connection string that was used previously and had to create my own. I added a ConnectionString key to the appSettings section of my App.config, and fired her up. The connection string pointed to a freshly generated copy of the database needed for the application. After a few seconds, I was presented with the following error "Error: SQL Server does not exist or access denied". Joy.
Because this error is so generic, there is a lot of information returned by Googling the message. Unfortunately there are a million things that might be the cause. I couldn't find a solution online, but ended up finding a fix for my specific situation.
If you are working with a project created using .Net Framework version 1.1, against a SQL Server 2005 DB, and trying to connect without specifying the ip and port of your db engined, you might get this error. What you might want to try is to replace your "data source" with the "ip,port" of your db engine and see if it fixes your issue.
OLD/Broken: <add key="ConnectionString" value="data source=.; initial catalog=YourDB; user id=YourUsr; password=YourPwd;" />
NEW/Working: <add key="ConnectionString" value="data source=127.0.0.1,1433; initial catalog=YourDB; user id=YourUsr; password=YourPwd;" />
Just one more thing to try when dealing with this very generic Error Message.
Wednesday, November 14, 2007
DNN Forums Upgrade - The type initializer for DotNetNuke.Modules.Forum.DataProvider
I was getting this error after trying to upgrade my DotNetNuke Forums module from a 3.* version to a 04.04.03. The error refers to a dll that is no longer valid from the old version. After spending some time trying to figure the error out, I ended up having to uninstall the old version and then install a fresh copy of the new version.
(WARNING - Unless you do some backing up and restoring of your Forums data, you will probably lose your existing posts. Keep this in mind.)
Anyone know of an easier way of getting the new version installed without having to uninstall the old one?
Monday, November 05, 2007
SQL Server 2005 Error - An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
You may receive this error when trying to remotely connect to your SQL Server 2005 (or Express) database. (Even when connection remotely from a service running locally, such as an ASP.NET website.) The first thing to check is the most common cause of this error. You must enable Remote Connection manually to SQL Server 2005 installations because they are disabled by default. To do this, check the following.
Enable remote connections for SQL Server 2005
- Open the SQL Server Surface Area Configuration tool. (You can find this in your start menu under SQL Server 2005.)
- Expand "Database Engine"
- Click on "Remote Connections"
- Enable Remote Connections (TCP/IP, Named Pipes, or Both)
- Click on Service under "Database Engine" and Stop then Start your database for the changes to take affect.
Test your connection now. For most people this will be sufficient to correct the problem. In my case, my company is using a connection string that did not specify the port when connecting to the database. I had just reinstalled Microsoft SQL Server and received this error and didn't want to have to change anything in the project to get it working again. I found that I had to statically set it for the server to SQL Server's default value of 1433. To do this, perform the following.
Set the port to be used with TCP/IP connections
- Open the SQL Server Configuration Manager
- 2xpand SQL Server 2005 Network Configuration and select "Protocols for YOURDBSERVERNAME"
- Right click on "TCP/IP" on the right and choose properties
- Click on the "IP Addresses" tab
- Set the TCP Port property for the entry with IP Address "127.0.0.1" or any other that you need and click "Apply".
In our case, this fixed the problem and allowed us to use our connection string unmodified.
Saturday, October 06, 2007
"Windows Live Messenger" or "Windows Media Player" has stopped working - APPCRASH / StackHash Error - Fix
----- ERROR MESSAGES -----
Windows Live Messenger has stopped working
Problem signature:
Problem Event Name: APPCRASH
Application Name: msnmsgr.exe
Application Version: 8.1.178.0
Application Timestamp: 45b12d6a
Fault Module Name: StackHash_ed38
ETC...
Windows Media Player has stopped working
Problem signature:
Problem Event Name: APPCRASH
Application Name: wmplayer.exe
Application Version: 11.0.6000.6336
Application Timestamp: 46a16548
Fault Module Name: StackHash_5255
ETC...
----- /ERRORS MESSAGES -----
Possible Fix 1: nVidia nForce driver components
I have an EVGA i650 Ultra motherboard in my system with the nForce drivers installed. Either of the two following nForce driver components / features might cause this problem in Vista.
- nVidia MediaShield
- nVidia - ForceWare Network Access Manager
Possible Cause 2: Vista's DEP Protection
To fix this issue, you might need to disable DEP in Vista. To disable DEP, perform the following (found these steps HERE.)
1. Click Start
2. Click All Programs
3. Click Accessories
4. Right Click on Command Prompt
5. Left click on Run as Administrator
6. Click the Allow button if it asks you for permission
7. Type or copy and paste this into the command prompt window:
bcdedit.exe /set {current} nx AlwaysOff
8. You should see the message "Operation Completed Successfully"
9. Reboot and DEP should be off.
For more information regarding DEP, what it is and how it affects your web-based applications. Checkout this link.
Possible Cause 3: Administrator Mode
You may also want to try running the application as an administrator. You can do this by right clicking on the short-cut, selecting properties and checking the "Run as administrator" box.
Tuesday, September 18, 2007
Visual Studio - Item Template Editing (Class, WPF, Forms, ETC...)
I've been working in Visual Studio for a few years now, and have created hundreds of classes, user controls, windows, forms, pages... You get the picture. I'm also the type of developer that likes to keep my code organized and generally start off with a couple of standard code regions (Fields, Properties, Events, etc...) in my classes and code-behind files.
I always imagined that there would be a simple way to override the default templates for these files to make my job easier, and today I finally spent the time to track it down...
Visual Studio Item Templates are located in the following directories...
Item Template Files
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplates
Item Template Cache Files
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache
Within each of these directories you'll have folders for CSharp, VisualBasic, etc. These folders hold all of the Item Templates for the named language. To edit the base implementation of the Class.cs file, you would browse to "C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\ItemTemplatesCache\CSharp\Code\1033\Class.zip" and load up the Class.cs file. This file would look something like this by default.
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ == 3.5)using System.Linq;
$endif$using System.Text;
namespace $rootnamespace$
{
class $safeitemrootname$
{
public $safeitemrootname$()
{
}
}
}
You might end up modifying this file like so to add a few regions by default...
using System;
using System.Collections.Generic;
$if$ ($targetframeworkversion$ == 3.5)using System.Linq;
$endif$using System.Text;
namespace $rootnamespace$
{
class $safeitemrootname$
{
#region Fields & Properties
#endregion
#region Constructors
public $safeitemrootname$()
{
}
#endregion
#region Private Methods
#endregion
#region Public Methods
#endregion
}
}
The next time you add a Class.cs file to one of your projects, it will come complete with the regions that you added to the template. You can also customize these templates further using other template parameters (i.e. '$clrversion$' for the Current version of the common language runtime (CLR).)
You can find a list of template parameters HERE....
Friday, September 07, 2007
Windows Vista - Window Focus - Alt + Tab Feature Tweaks
One of my favorite Vista features is their implementation of the Alt + Tab hotkey for switching window focus. Unlike Windows XP which would allow you to press Alt + Tab to cycle through your open windows. Windows Vista allows you to hold in Alt + Tab and then click on one of the displayed thumbnails to change focus.
Such a simple change, but with how often I use the hotkey to switch window focus. I find it much easier to hit the hotkey and quickly click on the window I want rather than cycling. My only problem with the feature is how small the icons are, especially on high resolution monitors. I found this great post which explains how to tweak this feature with a registry entry to make the displayed thumbnails any size you wish.
Save the following snippet to a text file with a .reg extension. Double-click the file you created to update your registry. This is optimized for my laptop's resolution of 1440X900, but feel free to tweak the settings for your resolution. You can tweak the size of each thumbnail, and the spacing between them...
(TIP: Use a Hexadecimal Converter to get your values right. Like This One)
#### Snippet ####
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AltTab]
"OverlayIconPx"=dword:00000023
"OverlayIconDXPx"=dword:00000000
"OverlayIconDYPx"=dword:00000000
"ThumbSpacingXPx"=dword:00000004
"ThumbSpacingYPx"=dword:00000004
"SideMarginPx"=dword:00000004
"BottomMarginPx"=dword:0000000a
"MinThumbSizePcent"=dword:00000064
"MinWidthPx"=dword:0000012c
"TopMarginPx"=dword:00000020
"MaxThumbSizePx"=dword:000000c8
"MaxIconSizePx"=dword:000000fa
"TextBottomPx"=dword:000001f4
####/Snippet####
To revert back to the original settings, remove the added key. "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\AltTab"
I also use a Logitech mouse that has 6 buttons. The mouse comes with it's own Document Switch feature, but I hate how they implemented it. A comment on the post I mention above recommended assigning this hotkey to a mouse button to make changing window focus even easier. On my Logitech mouse, I replaced their document switch button with the Ctrl + Alt + Tab hotkey (as recommended) which keeps the Alt+Tab selection window open indefinitely, so that you can click a thumbnail at your leisure... Very handy!
I am now using both of these tweaks and switching windows focus has never been easier, faster, or more intuitive. You should try it out.
Thursday, September 06, 2007
WPF - Error 3 API restriction: The assembly 'file:///C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStu
I was getting any annoying error (see below) in Visual Studio 2008 (Team System) Beta II after doing an SVN update. Every time I would try to compile our solution, I would get an error in our UnitTest project. The error was complaining that the UnitTestFramework.dll was being loaded from two different locations within the same appdomain.
"Error 3 API restriction: The assembly 'file:///C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies\Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll' has already loaded from a different location. It cannot be loaded from a new location within the same appdomain."
The problem was that two of the projects in our solution were referencing UnitTesting DLLs. For some reason someone added references to the following two libraries in our DAL project, and the compiler was throwing a fit that the UnitTestFramework dll was getting loaded from two different locations within the appdomain.
- Microsoft.VisualStudio.QualityTools.UnitTestFramework
- Microsoft.VisualStudio.TeamSystem.Data.UnitTesting
Removing these two (unneeded) references from our DAL project fixed the issue, but the error seemed a bit vague.
(NOTE: You may need to close and then reopen Visual Studio since the library might still be loaded...) =( Took me 10 minutes to figure this out...)
Thursday, August 16, 2007
xkcd.com Excuse for legitimately slacking off Comic

Check it and others out at xkcd.com!
Wednesday, August 01, 2007
Microsoft Messenger Scam/Hoax/Virus - www.messengerstatus.biz
If you get an instant message with the following message, don't click on it. If you MUST click on it, don't enter your username and password.
"Did someone delete you from their MSN? Check http://www.messengerstatus.biz it's really good and it works!!!"
The site asks for your Microsoft Messenger username and password, then I believe that it promptly logs onto your messenger account and sends the same message to all of your contacts.
If you HAVE registered. Change the password of your Messenger E-mail account ASAP, and be more careful!
I've gotten a lot of these IM's today from people on my contact list, and figured I'd post a warning...
Sunday, July 29, 2007
Impressive HTML Skills...
Check it out here...
Friday, July 27, 2007
Visual Studio 2008 Beta 2 Released!
The Beta 2 release of Visual Studio 2008 has been released and is available for download from the HERE. This release sport the following new features.
- VS 2008 Multi-Targeting Support
- VS 2008 Web Designer and CSS Support
- ASP.Net Ajax and JavaScript Support
- Language Improvements and LINQ
- Data Access Improvements with LINQ to SQL
- And much much more...
Check out Scott's post here for more details...
Tuesday, June 26, 2007
Vista, IIS7 & DotNetNuke - NullReferenceException at GetEnabledLocales()
Upgraded to Vista with IIS7 and started getting an error when trying to run an existing DotNetNuke ASP.Net project I've been working on.
Here's a snippet from the stack trace...
DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Localization.Localization.GetEnabledLocales()
Was able to figure this one out after playing with the IIS7 settings for a while. You need to update your IIS application to use a different application pool than the default. Right click on your application in IIS and select Advanced Settings. Under Behavior change the Application Pool from DefaultAppPool to Classic .NET AppPool.
That should clear up this issue for you.
Monday, June 25, 2007
Pandora's Box - Play Pandora minimized or in your system tray...
If you have read my post about iTunes vs Pandora, you'd know that I dig the new online service for streaming tunes at work. The only problem with the service, in my opinion, is that you need to leave a browser window open while listening...
I started to look for a solution to allow you to either minimize your Pandora or play it in your System Tray. I found a cool little app that lets you do just this. You even get a nice context menu from the system tray icon that allows you to issue commands to Pandora without having opening it.
Makes Pandora even better IMO! Check it out.
Installing Infragistics on Vista Ultimate with IIS 7.0
I just upgraded to Windows Vista this weekend and am trying to get my development box up and running. We us Infragistics in a couple of our ASP.Net projects and I'm finding that it's not quite as straight forward to install it on Vista.
I found a great site with a walk-through of how to setup your Vista and IIS to allows Infragistics to install correctly.
Basically you need to do the following...
- Disable User Account Control (UAC)
- Restart your machine
- Edit the path of your IIS WWWRoot folder in the registry
- Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\PathWWWRoot
- Change "%SystemDrive%\inetpub\wwwroot" to "C:\inetpub\wwwroot"
- Enable IIS 6.0 Compatibility in the "Turn Windows features on or off" section of the Programs menu (make sure to check all the child boxes)
That should allow you to get your infragistics installed on Windows Vista Ultimate and IIS 7.0.
Developing on Windows Vista
I recently took the plunge and installed Vista Ultimate on my Dev box. I'm sure this will have it's ups and downs, but on the bright side... It will most definitely spawn lots of blog posts.
I will be installing Orcas soon and playing around too. I will also be focusing as much as I can on WPF, WCF, and WWF, so I'm sure I will have a lot of fun stuff to blog about for the next few months (after I get back from my Honeymoon that is. Yay for Hawaii...!)