Recently, I had to restore StarTeam 2005 on a Windows 2003 Server.
An out-of-the-box install using MSDE 2000 does not want to run as a service.
This post shows you how I solved that problem. Read the rest of this entry »
Posted by jpluimers on 2010/08/24
Recently, I had to restore StarTeam 2005 on a Windows 2003 Server.
An out-of-the-box install using MSDE 2000 does not want to run as a service.
This post shows you how I solved that problem. Read the rest of this entry »
Posted in Database Development, Development, MSDE 2000, Power User, Software Development, Source Code Management, SQL Server, SQL Server 2000, StarTeam, Windows, Windows Server 2003 | Leave a Comment »
Posted by jpluimers on 2010/08/20
When you write .NET 4 software, you want to deploy it to your clients, so they need to install the .NET Framework 4.
On fully patched Windows Server 2003 x86 installations, the (optional) Windows Update for Microsoft .NET Framework 4 for Windows Server 2003 x86 (KB982671) usually results in this error:
Installation Failure
Error Code: 0x80246002
Try to install the update again, or request help from one of the following resources.
It fails during download, so it does not even reach the install phase.
Don’t loose too much time resolving this: The usual solution for 0x80246002 as described in KB958056 does not work.
The systems affected don’t have anti-virus or similar software installed, so disabling those won’t work: there is nothing to disable.
What does work is the suggestion a bit lower in the 0x80246002 update fails search results Read the rest of this entry »
Posted in .NET, Delphi, Development, Power User, Prism, Software Development | 8 Comments »
Posted by jpluimers on 2010/08/19
In my VM’s, I often run different instances and/or versions of SQL Server.
Finding the right instance of SQL server, and the right version of SQLCMD.EXE / OSQL.EXE can be a pain.
That’s why I have written the two batch-files shown below for that.
They are not perfect, but they do work for me, and show a few interesting batch-file tricks.
As for preferring SQLCMD: [WayBack] sql server – What are the differences between osql, isql, and sqlcmd? – Stack Overflow
This finds the most up-to-date SQLCMD.EXE (or OSQL.EXE for SQL Server 2000) and puts the location of it in the sqlcmd environment variable.
@echo off
rem find the highest version of SQLCMD.EXE or OSQL.EXE and put it in the sqlcmd environment variable
rem this prefers SQLCMD.EXE over OSQL.EXE
set sqlcmd=
for %%d in ("%ProgramFiles%", "%ProgramFiles(x86)%") do for %%v in (80, 90, 100) do for %%f in (OSQL, SQLCMD) do (
call :sqlcmdtest "%%~d\Microsoft SQL Server\%%v\Tools\Binn\%%f.EXE" %1
)
if !!==!%sqlcmd%! for %%f in (OSQL, SQLCMD) do (
call :find-on-path %%f.EXE
)
if !%1!==!! echo SQLCMD: %sqlcmd%
goto :exit
rem be carefull not to specify the .EXE in the %%f FOR loop-expression, otherwise it tries to dine SQLCMD.EXE and OQSL.EXE in the current directory
rem http://msdn.microsoft.com/en-us/library/ms178653.aspx
rem 80 = SQL Server 2000
rem 90 = SQL Server 2005
rem 100 = SQL Server 2008 and 2008 R2
:find-on-path
set sqlcmd=%~f$PATH:1
if not ""=="%sqlcmd%" set sqlcmd="%sqlcmd%"
goto :exit
:sqlcmdtest
if exist %1 if !%2!==!! echo found %1
if exist %1 set sqlcmd=%1
:exit
Tricks used:
This batch file finds the SQL Server instances on the local machines from the naming of the SQL Server services that are running.
Note that it won’t work if you choose custom names for your SQL Server services (but that will probably break a lot of other stuff out there as well).
@echo off rem find best matching instance of SQL Server on this machine set sqlinstance= set sqlservice= for /f "usebackq tokens=1,2,3 delims=:$" %%i in (`sc query`) do ( rem %%j is " MSSQL" because we dropped space as a delimiter if "%%i"=="SERVICE_NAME" call :bare-service %%j %%k ) if !%1!==!! echo SQL Instance=%sqlinstance% if !%1!==!! echo SQL Service=%sqlservice% goto :exit :bare-service rem %1 equals "MSSQL" because of the command-line parsing trims spaces rem the order is important: we favour named instances over unnamed: if "%1"=="MSSQLSERVER" call :process-instance %1 . if "%1"=="MSSQL" call :process-instance MSSQL$%2 .\%2 goto :exit :process-instance if !%1!==!! echo found service "%1" providing instance "%2" if "%sqlinstance%"=="" set sqlinstance=%2& set sqlservice=%1 for /f "usebackq tokens=1,2,3,4" %%s in (`sc query %1`) do ( if "%%s"=="STATE" if !%1!==!! echo state of %1 is %%v ) goto :exit :exit
Tricks used:
sc query sample fragment:
SERVICE_NAME: MSSQL$SQLEXPRESS
DISPLAY_NAME: SQL Server (SQLEXPRESS)
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
My final batch-file ties both together:
set sqlrun= call %~dp0sql-find-sqlcmd.bat %* call %~dp0sql-find-instance.bat %* if not !!==!%sqlcmd%! if not !!==!%sqlinstance%! set sqlrun=%sqlcmd% -S %sqlinstance% -E if !%1!==!! echo SQLRUN=%sqlrun%
The output of that batch-file is like this:
found "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\OSQL.EXE" found "C:\Program Files\Microsoft SQL Server\90\Tools\Binn\SQLCMD.EXE" found "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\OSQL.EXE" found "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" SQLCMD: "C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" found ".\SQLEXPRESS" state of service MSSQL$SQLEXPRESS with SQL Server instance .\SQLEXPRESS is RUNNING found "MSSQLSERVER" (.) state of service MSSQLSERVER with SQL Server instance . is RUNNING SQL Instance=.\SQLEXPRESS SQLRUN="C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S .\SQLEXPRESS -E
Hope this helps a few people.
–jeroen
Posted in CommandLine, Database Development, Development, Software Development, SQL Server | 8 Comments »
Posted by jpluimers on 2010/08/18
Next week, I’ll be speaking at Delphi Live 2010 in San Jose, California.
, USA.
At the end of september, I’ll be speaking at EKON 14, in Darmstadt, Germany. My 14th appearance at EKON!
Delphi Live (sessions in English):
EKON 14 (Sessions auf Deutsch / in German):
Hope tho see some of you people at one of those events.
I will bring some USB audio equipment, so I might do a bit of geek stuff doing ASIO audio on those events too.
–jeroen
Posted in Conferences, Delphi, DelphiLive, Development, EKON, Event, Software Development | 5 Comments »
Posted by jpluimers on 2010/08/17
On the Embarcadero forum, Jolyon Smith asked about the underlying meaning of the 64-bit Pulsar statements in the updated Roadmap.
He did not ask for an exact date, but what level of 64-support is the current goal.
Allen Bauer (Chief Scientist at Embarcadero) was kind enough to put up a few answers.
A few quotes are below, please read the full thread titled Embarcadero Discussion Forums: Roadmap: Clarification Required Please … for the exact answers.
It basically boils down to this: Read the rest of this entry »
Posted in Delphi, Development, Software Development | 9 Comments »
Posted by jpluimers on 2010/08/11
Lately, CodePlex is in the progress of [WayBack] migrating from TFS2008 to TFS2010 (they [Archive.is] have done TFS05…TFS01 and TFS07; TFS06 and TFS08…TFS10 still need to be done).
When your projects have been migrated (or you are going to use TFS2010 yourself), and you use VS2008 (or VS2005 – which I have not tested yet), you need to perform some updates and configuration changes to connect to the new TFS2010 servers.
So this post is about connecting from VS2008 to TFS2010 on CodePlex.
The tips will also work when connecting to a regular TFS2010 server: the connection URL is slightly different. Read the rest of this entry »
Posted in .NET, CodePlex, Development, Software Development, Source Code Management, TFS (Team Foundation System) | Leave a Comment »
Posted by jpluimers on 2010/08/10
It is good to see the cross breeding effect works:
Last week, the Visual Studio 2010 Productivity Power Tools added Quick Access Extension, which is the Visual Studio equivalent of the Delphi RAD Studio IDE Insight.
It is a keyboard shortcut (Delphi: F6 or Ctrl-.; Visual Studio: Ctrl+3) to search and execute things defined by the environment:
Delphi has a few options that Visual Studio hasn’t and vice versa, but it comes really close.
–jeroen
Posted in .NET, Delphi, Development, Keyboards and Keyboard Shortcuts, Power User, Software Development, Visual Studio and tools | 2 Comments »
Posted by jpluimers on 2010/07/29
One of the toughest parts on creating a new [Archive.is] CodePlex project is choosing a license.
As Jeff Attwood wrote a couple of years ago, choosing a license – any license – is important, because if you don’t, you declare an implicit copyright without explaining how others could use your code.
In addition to that, Jeff published a list of licenses with a one-line phrase describing them, so it becomes easier to start making a choice.
Last year, ShreevastaR extended that list in his answer to this StackOverflow.com question on CodePlex licensing.
Brian Campbell did the same a few months later on another StackOverflow question about CodePlex licensing.
There are many more StackOverflow.com threads like those 2, and they give similar results.
The reason I want to put up a CodePlex project, is to put my sample code for conferences, blog articles and course examples on-line so they are easier to share with other people.
Most is from Visual Studio or Delphi projects using languages C#, VB.NET and Delphi.
Some of it are batch-files, XSD, XSLT, or other small snippets to get stuff working. Read the rest of this entry »
Posted in .NET, Access, CodePlex, Database Development, Delphi, Development, Firebird, InterBase, Software Development, SQL Server | 4 Comments »
Posted by jpluimers on 2010/07/28
I want my exceptions to be bound to my business classes.
So you need your own exception class, and are expected to override the 4 constructors of the Exception class.
But I got a bit tired of writing code like this again and again:
using System;
using System.Runtime.Serialization;
namespace bo.Sandbox
{
public class MyException : Exception
{
public MyException()
: base()
{
}
public MyException(string message)
: base(message)
{
}
public MyException(string message, MyException inner)
: base(message, inner)
{
}
public MyException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
}
Searching for Generic Exception Class did not reveal any generic exception classes.
So I wrote this instead: Read the rest of this entry »
Posted in .NET, C#, C# 2.0, Development, Software Development | Leave a Comment »
Posted by jpluimers on 2010/07/27
Like Keith Barrows, each time I see a message like below, I’m reminded that I forgot to change my Visual Studio 2005/2008/2010 to disable these kinds of MDA messages:
ContextSwitchDeadlock was detected Message: The CLR has been unable to transition from COM context 0x1a7728 to COM context 0x1a75b8 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
Steps to get rid of these messages:
Maybe I won’t forget this next time :>
–jeroen
Via: Keith Barrows : ContextSwitchDeadlock was detected Message.
Posted in .NET, Development, Software Development, Visual Studio and tools | 1 Comment »