Saturday, October 10, 2009

Rebuild master DB SQL Server 2008

1. From a command prompt window change to the following directory:

"C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Release"

2. Next paste the following into the command prompt window and press “Enter”:

Setup.Exe /Action=RebuildDatabase /InstanceName=MSSQLSERVER /SqlSysAdminAccounts=Admin /Quiet

If you have SQL configured for Mixed Authentication Mode use the same syntax except you must also provide the /SAPWD parameter to specify the SA password. If you don't, you will get an error.

Thursday, October 1, 2009

JavaScript in C#

Page.ClientScript.RegisterStartupScript(GetType(), "hideWatermark", "<script type="\">function hideWatermark(element){ if (element.value == 'Fill to change display name') { element.value = ''; } element.style.color = 'black'; }</script>");

control.Attributes.Add("onfocus", "javascript:hideWatermark(this)");

Wednesday, September 23, 2009

The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)

Post from: http://kbarret3.spaces.live.com/blog/cns!5E66707AED54DB49!414.entry


During the process of trying to upgrade to SP1 on our MOSS and Project Server 2007 environment I hit the following problem when finally running configuration wizard which stopped it dead in its tracks...

An exception of type System.Runtime.InteropServices.COMException was thrown.

Additional exception information: The path specified cannot be used at this time. (Exception from HRESULT: 0x80070094)

After searching around I could find nothing in TechNet, MSDN or the wider Internet that applied to this error message. I did find an interesting but what seemed unrelated blog entry about SSP and Index Services becoming unstable but this had nothing to do with with running the SharePoint Configuration Wizard! Interestingly the final line in the blog entry indicated that the author had received a "The path specified cannot be used at this time" error when trying to start IIS Manager" so I decided to try and open IIS Manager as well. IIS Manager started up without the error but show no connected IIS server. Next I tried to attach to the server (Actions --> Connect) and now I received the same "The path specified cannot be used at this time" error!

I found the easiest way to fix this was to do and IISRESET and restart IIS Manager. After this IIS Manager started up fine with the expected server connection and the SharePoint Configuration Wizard ran through to completion without errors.

The resource object with key was not found

  1. On your SharePoint Web-Front-End Server navigate to 'C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\CONFIG\Resources'
  2. Copy needed resource files (.resx).
  3. Navigate to the IIS Virtual Directory of your SharePoint web site
  4. Copy resource files into the Virtual Directory's App_GlobalResources folder
  5. Perform an IISRESET
  6. Refresh your page.

Tuesday, September 22, 2009

32 Bit ODBC Drivers in Vista 64

Post from: http://postgresqldbnews.blogspot.com/2008/03/32-bit-odbc-drivers-in-vista-64.html

This post isn't really PostgreSQL specific. It also happens with MySQL and Ingres (and any other 32 bit driver).

I am running Vista 64 on one of my machines. I installed Postgres 8.3 and the ODBC drivers. When I tried to setup an ODBC connection, the windows ODBC administrator program ODBCAD32.exe did not list Postgres. I noticed that it also did not list MySQL or Ingres even though I knew I had installed drivers for those databases also.

After a bit of research, I tracked down the issue. My ODBC drivers did in fact install. Microsoft, in all their wisdom, has 2 versions of odbcad32. A 32 bit and a 64 bit. They are both named odbcad32.exe.

It gets better. They put the 32 bit odbcad32.exe in the syswow64 directory. They put the 64 bit odbcad32.exe in the system32 directory. 32 bit apps will pick up the 32 bit registry setting and 64 bit will pick up the 64 bit registry setting. system32 comes before syswow64 in the system path so the 64bit software runs before the 32 bit software.

So, when I manually ran odbcad32.exe in the syswow64 directory, I was able to configure my connections and everything worked hunky dory. I know have a shortcut to syswow64\odbcad32.exe on my desktop for working with 32 bit databases.

I wonder how stable the system would be if syswow64 was in the path before system32? I don't plan to find out.

C:\Windows\syswow64\odbcad32.exe

Tuesday, September 1, 2009

Using App.Config Settings in BizTalk 2004

This is an example of how to use app.config settings in a BizTalk 2004 Orchestration.
First, you must setup the configuration section that you want to use. This is an example of what this looks like:

<!--This is an example of setting up your configuration section-->
<configuation>
<configSections>
<section name='MyConfigSection' type='System.Configuration.NameValueSectionHandler' />
</configSections>

<MyConfigSection>
<add key='MyKey' value='MyValue' />
</MyConfigSection>
</configuration>

Then, create an orchestration variable of type System.Collections.Specialized.NameValueCollection (I'll call it varConfigHandler)

This is an example of using the varConfigHandler in an expression shape:

// varConfigHandler has to be instantiated and bound to the config section we are interested in
// Notice that the result of the GetConfig function call is being cast into a NameValueCollection
varConfigHandler = new System.Collections.Specialized.NameValueCollection((
System.Collections.Specialized.NameValueCollection)
System.Configuration.ConfigurationSettings.GetConfig("MyConfigSection"));

// Now, we can access keys in the config section
varConfigHandler.Get("MyKey");

For deployment, copy the configSections/section and MyConfigSection into the config file for the BizTalk Service which is located at:

C:\Program Files\Microsoft BizTalk Server 2004\BTSNTSvc.exe.config

Tuesday, July 21, 2009

Error 5009.Registration of BAM performance counters failed. Return code -1.

Post from: http://blogs.msdn.com/balachandra/archive/2008/10/20/error-5009-registration-of-bam-performance-counters-failed-return-code-1.aspx

In one of my project I was remote installing BizTalk server on the dev machine and I encountered a strange error. "Error 5009. Registration of BAM performance counters failed. Return code -1." I searched and digged in for a solution and found that the performance counter registry may be damaged and the counters need to rebuilt. One of the forum thread suggested the use of lodctr exe with /r option for rebuilding counters. I tried however din't work for me. Let me tell you that my dev machine was running Windows 2003 server and I was not sure whether /r option was supported in that version of lodctr as the help text(use /?) did not show the option however though it showed the option /R: which restores performance registry strings from the specified filename. I also tried to restore PerfStrinBackup.ini file, din't work either. Then I tried the lodctr exe in Vista OS. This version supported the required option. I copied this version of exe to the dev machine and tried executing "lodctr /R". bingo! It worked!!. However please note I don't say that this is the right solution because there may be licencing issues associated in using Vista components in Windows 2003.