ASP.NET
I was building a quick test web site and I was using the aspnet_regsql tool to add membership to a SQLEXPRESS database. At first, I tried: aspnet_regsql -A all -C "Data Source=.\SQLEXPRESS;Integrated Security=True;User Instance=True" -d "C:\code\Test\APP_DATA\aspnetdb.mdf" For some reason, the SqlConnection insisted that it try to create the database and disregarded the full path to the database (note the path in the exception).SQL Exception:
System.Data.SqlClient.SqlException: Directory lookup for the file "C:\Documents and Settings\user\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS\C:\code\Asp.net\ServerControlTest\App_Data\Database.mdf" failed with the operating system error 123(The filename, directory name, or volume label syntax is incorrect.).
CREATE DATABASE failed. Some file names listed...
I recently set up an isolated, single-server SharePoint site with forms-based authentication (FBA) with the hopes that it would eliminate the need to create unrelated user accounts for all of the SharePoint users. The FBA setup and installation went fine and I used the SharePoint FBA tool on codeplex to administer the accounts and users which is great. Unfortunately I didn't realize that disabling "Client Integration" in the SharePoint Cental Admin / Application Management / Authentication Providers would have such a dramatic effect on usability. Some of the challenges are using SharePoint Designer, the MySites functionality is impacted, inability to...
I finally worked on my blog theme last night and I managed to get the dp.SyntaxHighlighter to work with Subtext. I recall seeing someone else use it with Subtext, but I can't locate the blog anymore. Here are the steps involved: Create a custom skin for Subtext Copy the shCore.js, shBrushCSharp.js, shBrushXxx.js files in the custom skin Scripts directory (~/Skins/YourCustomSkin/Controls) Copy the SyntaxHighlighter.css file to the custom skin Styles directory (~/Skins/YourCustomSkin/Styles). If you choose to use the Flash clipboard.swf functionality, place it in the root Scripts directory. Create a Skins.User.config file in the ~/Admin directory. Add...
I was reading my email when I came across this blog about the death of single-threaded development. Now I've written many multi-threaded applications in C++ for applications, communications, and graphical displays, but I don't see the death of single-threaded development any time soon. I even wrote a paper while I was at university about how multi-threaded programming should be introduced in the curriculum much earlier. At the very least, the multi-threaded thought process should be taught but I don't see that happening. Samples are usually distributed as single-threaded applications because they are easier to understand. Unfortunately people replicate the same...
I really like Subtext, but unfortunately I haven't had too much time to try to configure my blog. I've looked through the wiki, but haven't seen enough information to emulate the configuration of Subtext founder Phil Haack. For example, the FeedBurner plugin which lists the number of subscribers and links to get the RSS and even email feeds -- how exactly is that configured? I suppose I should RTFM but I'm having trouble finding it at the moment (not to mention I have way too much to do right now with work!). It seems the Subtext Wiki is describing plug-in...
A while back I needed to disable fields on a web page during submit and I found a utility written by Nancy Michell for MSDN Magazine. The utility covered the basic cases, but I found that I needed to use it for AJAX style calls as well as standard submits. So I modified the code to include an enable function as well. Finally I added exception handling around the disable and enable code to avoid pesky Javascript errors. The only thing I might change is to capture an array of the controls that were successfully disabled and then process only...
I was just reading an article on Builder.com about exception handling and it reminded me of some of my pet peeves regarding exception handling. Don't assume you have permissions to write to the Event Log! - Many people add code to log exceptions to the Event Log however they do not add any exception handling in case it fails. This is especially true for ASP.NET as many corporate networks are severely restricting permissions. It is possible for the System.Diagnostics.EventLog.WriteEntry() to throw exceptions! The exception for permissions issue is System.Security.SecurityException. Best practice is to use a wrapper function...
I decided to publish a short article about time zone adjustment. While it uses a Microsoft KB article as the basis for the algorithm, the interesting portion of the code actually has to do with setting the client time zone and cookies. See the article here.