Author Archive

To get the path where SQL Server 2005 stores data files for databases, you can use the following T-SQL script:

USE master

DECLARE @data_path nvarchar(256)
SET @data_path = (SELECT SUBSTRING(physical_name, 1, CHARINDEX(N'master.mdf', LOWER(physical_name)) - 1)
FROM master.sys.master_files
WHERE database_id = 1 AND file_id = 1)

SELECT @data_path AS DataPath

It uses the built-in “master” database, finds the physical path to it from the “master.sys.master_files” view, then takes a substring to get just the path portion.

Tags: , ,

Comments No Comments »

I got an error when trying to add postback triggers for the ScriptManager control in ASP.NET by using the UpdatePanel.PostbackControls.Add[] method and passing in the control’s id. In my situation, I had a GridView that was wrapped in an UpdatePanel and I wanted the edit column to trigger a postback and link to another page. I received the error “A control with ID ‘ctl00_foo could not be found for the trigger in UpdatePanel ‘myUpdatePanel’.” when I tried to register the control in the postback controls collection. I got this error when passing in the ID, ClientID, and UniqueID properties of the control.

To fix this, I instead used the ScriptManager.RegisterPostbackControl() method (passing in the control itself as a parameter). If you’re using masterpages (as I was), you will need to expose the ScriptManager from the MasterPage as a public property and reference the masterpage in the client page (like so).

Tags: , , ,

Comments No Comments »

I had an existing local branch that I had done some commits to and wanted to create a remote branch on origin so that I could check it out to other local branches on different machines. The current version of Git (1.6.1.x at the time of this writing), doesn’t seem to have an elegant way of doing this, but still I was able to do it fairly simply by manually editing Git’s “config” file (inside of the “.git” folder of a working directory). Read the rest of this entry »

Tags: , ,

Comments 2 Comments »

When upgrading from SAP Business Objects XI R2 service pack 1 to service pack 2, I got the following error in the Java runtime console when trying to create new or use existing Web Intelligence reports:

load: class not found.
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at Source)
at Source)
Caused by: open HTTP connection failed.
at sun.applet.AppletClassLoader.getBytes(Unknown Source)
at sun.applet.AppletClassLoader.access$100(Unknown Source)
at sun.applet.AppletClassLoader$ Source)
at Method)
... 10 more

To fix this, I had to go on the web server machine that hosts Business Objects and copy the “webiApplet” folder from “Program Files\Business Objects\BusinessObjects Enterprise 11.5\Web Content\Enterprise115″ to “Program Files\Business Objects\BusinessObjects Enterprise 11.5\Web Content\Enterprise115\InfoView”.

Tags: , , ,

Comments 3 Comments »

When using git-stash from a Windows command prompt, I would get errors when trying to manipulate stashes.

For example, after running “git stash” to create a stash, if I later listed the available stashes with “git stash list” (which would return something like “stash@{0}: WIP on mybranch: 669dc9c… My comments”) and then tried to apply the stash with “git stash apply stash@{0}”, I would get the error “fatal: Needed a single revision
stash@0: no valid stashed state found”.

I noticed that the curly braces were missing in the error message, so I had to escape them with “git stash apply stash@\{0\}” to get the command to work.

I also got this error when trying to drop or pop a stash (e.g. “git stash drop stash@{0}”), and had to escape the curly braces here as well.

Tags: , , , , ,

Comments 5 Comments »