The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for September, 2009

.NET – getting text/html in stead of text/xml on your SOAP calls?

Posted by jpluimers on 2009/09/29

Recently, we got this on a project:

inner=System.InvalidOperationException: Client found response content type of ‘text/html;charset=utf-8’, but expected ‘text/xml’.
The request failed with an empty response.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)


Usually this means that the request did not get passed from the WebServer to the actual SOAP layer.
In this particular case it was an overly active ISA admin that had blocked the access to the underlying SOAP Web Service.

–jeroen

Posted in Development, SOAP/WebServices | Leave a Comment »

Turbo Power projects finally coming alive again? Nick Hodges is now tpsfadmin on SourceForge – DelphiFeeds.com

Posted by jpluimers on 2009/09/29

Nick Hodges just posted he has become the tpfsadmin on sourceforge: the administrative account for the Turbo Power tools and libraries.

It is not an officially sponsored Embarcadero thing, but at best semi official.

However, it is an admirable step into getting the Turbo Power tools and libraries updated in one central place again.

Those tools include OnGuard, Orpheus, SysTools, FlashFiler, B-TreeFiler, Async Professional and many others.

So if you have your own fork of any of the Turbo Power code from sourceforge, then please drop Nick a note.

Many thanks to Nick!

–jeroen

Posted in .NET, Database Development, Delphi, Development, Software Development, Source Code Management, SourceForge, Web Development | 6 Comments »

Delphi – record and class helpers: an overview of useful links

Posted by jpluimers on 2009/09/28

At the EKON13 conference, I will be presenting a talk about record and class helpers.

This morning, my laptop did “beeeeeeep beep beep” followed by a deadly silence.
It will take a while before my spare laptop arrives at the hotel and my Vista and VM’s are working again.
So I needed to redo some of my preparations to make sure that I can do a ‘plan B’ if restoring on the spare laptop fails.

Hence below a list of useful links, not yet in a particular order, but it saves you browsing through search engine results sifting the good from the not so good info.

Posted in .NET, .NET CF, Conferences, Delphi, Development, EKON, Event, Software Development | Leave a Comment »

SQL Server notes

Posted by jpluimers on 2009/09/25

Sitting in on Maciej Pilecki’s BASTA! 2009 session on “Advanced SQL Server Troubleshooting” is fun.

First of all it gives a good overview of many topics for which information usually is spreaded.

And there are many new things, for instance some of them about login failures:

Understanding “login failed” – the “state” part is important!

State=16 is undocumented, it can mean that the Administrator Studio is not being run with “Administrative Privileges” (UAC!) under Vista or Windows 7, or you are not allowed to login to the particular database.

Some other useful links

How to use Kerberos authentication in SQL Server (KB 319723).

Cannot create SSPI context (KB 811889).

DMV: Dynamic Management Views.
Sample:

select *
from sysobjects
where name like 'dm_%'
order by name

select *
from sys.dm_os_sys_info

When a LOG file is missing, state_desc in the below query will show ‘RECOVERY_PENDING’

select *
from sys.databases

If you have a database backup and all the log files since that instant in time, you can restore your data.

Last resort: You can try open a database in EMERGENCY mode now (but your DB might be inconsistent because some of the transactions might be open):

ALTER DATABASE Northwind SET EMERGENCY

DBCC CHECKDB('Northwind') -- now (wrongly!) indicates no errors

Trick to loose your SQL SERVER log file. The two most important commands there:

SET DATABASE DemoSuspect SET EMERGENCY
GO
SET DATABASE DemoSuspect SET SINGLE_USER
GO
DBCC CHECKDB ('DemoSuspect', REPAIR_ALLOW_DATA_LOSS) WITH NO_INFOMSGS, ALL_ERRORMSGS;
GO
SET DATABASE DemoSuspect SET MULTI_USER
GO

Note that because of the repair, you lost ‘transactional consistency’!

Memory usage:

Page life expectancy should not fall below 300 seconds for a longer period of time.

When in doubt: Reboot!

Manually geneate a BSOD in order to be able to debug a hung system.
It can now also be done with USB keyboards in Windows Server 2003 SP2 and up, and Windows 7.
See also thishttp://support.microsoft.com/kb/972110.

Some more interesting links:

Encryption Hierarchy / Encryption Hierarchy

– Book: SQL Server 2005 Practical Troubleshooting (by the late Ken Henderson)

Security in SQL Server 2005

SQL Server 2005 Data Encryption and data length limitations

–jeroen

Posted in BASTA!, Conferences, Database Development, Development, Event, SQL Server | Leave a Comment »

Reminder to Self – JavaScript and CSS compression

Posted by jpluimers on 2009/09/21

Since bandwitdth for a lot of users can still be an issue*, it pays off to make your web-pages as light-weight as possible.

When using JavaScript and/or CSS in your sites, you can compress them to save bandwidth.
A good compressor for this is  the YUI Compressor, which can compress both JavaScript and CSS.

* Bandwidth can be an issue for instance for people having only GPRS, EDGE or UMTS/3G access, or countries where DSL and cable are not abundant.

Posted in CSS, Development, Software Development, Web Development | Leave a Comment »

Reminder to self: what to do if RDP (MSTSC) or VMware clipboard sharing is broken

Posted by jpluimers on 2009/09/18

Some things to check when clipboard sharing for Remote Desktop (RDP/MSTSC) or VMware is broken. Read the rest of this entry »

Posted in Fusion, Power User, Remote Desktop Protocol/MSTSC/Terminal Services, View, VMware, VMware Workstation, Windows, Windows 7, Windows Server 2000, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP | Leave a Comment »

CodeRage 4 session material download locations changed – CodeCentral messed up

Posted by jpluimers on 2009/09/18

Somehow, CodeCentral managed to not only delete my uploaded CodeRage 4 session materials (the videos are fine!), but also newer uploads with other submissions.

Since I’m in crush mode to get the BASTA! and DelphiLive 2009 Germany sessions done, and all Embarcadero sites having to do with their membership server perform like a dead horse, I have temporary moved the downloads, and corrected my earlier post on the downloads.

I have notified Embarcadero of the problems, so I’m pretty sure they are being addressed on their side as well.
Edit 20090919: Embarcadero indicated that between 20090913 and 20090914 there has been a database restore on CodeCentral. Some entries therefore have been permanently lost.

When I get back from the conferences, and CodeCentral is more responsive, I’ll retry uploading it there, and correct the posts.
In the mean time, be sure not to save shortcuts to the current locations, as they are bound to change.

The are the new download locations can all be found in my xs4all temporary CodeRage 4 2009 download folder.

This is the full list of my CodeRage 4 sessions and places where you can download everything: Read the rest of this entry »

Posted in .NET, ASCII, CodeRage, CommandLine, Conferences, CP437/OEM 437/PC-8, Database Development, Debugging, Delphi, Development, Encoding, Event, Firebird, InterBase, ISO-8859, ISO8859, Prism, Software Development, SQL Server, Unicode, UTF-8, UTF8, Windows-1252 | 1 Comment »

SQL-Server: Triggers fire on multiple records – what to watch for

Posted by jpluimers on 2009/09/16

SQL Server triggers can operate on multiple records at once.
So it is important to not only to make your triggers work properly, but also make them work performantly.

Given a table like the Users table below, which in the future is likely to be extended with fields like Initials, MaidenName, Suffix, Prefix, etc.
The client has choosen not to make the FullName calculated, but update it using a trigger.

CREATE TABLE [dbo].[Users](
	[UserId] [int] IDENTITY(1,1) NOT NULL,
	[FullName] [nvarchar](100) NULL,
	[FirstName] [nvarchar](50) NULL,
	[LastName] [nvarchar](100) NULL
) ON [PRIMARY]

A trigger that updates the FullName field is only needed for Insert and Update statements.
It needs to update the FullName for all the records in that statement, but not for any other records.
Read the rest of this entry »

Posted in Database Development, Development, SQL Server | 2 Comments »

.NET/C# – ExceptionCatcher and ExceptionHelper gems

Posted by jpluimers on 2009/09/14

http://it-republik.de/dotnet/basta/The class presented in this article is part of my “.NET Gems – Small Pieces of Code that make your Day” session that will be presented at the BASTA! conference next week in Mainz, Germany.
It is going to be a fun conference, with lots of (internationally) renowned speakers (like Oliver Sturm, Ingo Rammer, Stephen Forte, Neil Ford and Dino Esposito).
Well worth attending!

OK. Let’s show the gems, and assume you are writing a method that is not allowed to let exceptions leave it’s implementation.
This is a common case, for instance you develop COM Servers, Windows Services and to a lesser extent Web Services.
Read the rest of this entry »

Posted in .NET, BASTA!, C#, C# 2.0, Development, Event, Software Development, Visual Studio and tools | Leave a Comment »

CodeRage 4: session replays are online too!

Posted by jpluimers on 2009/09/13

Embarcadero has made available the replays of the CodeRage 4 sessions.
You can find them in the CodeRage 4 sessions overview.

In order to download them from that overview, NOTE: To access this session replay, you must be logged into EDN. you can login or sign-up (which is free).

To make it easier to find all the relevant downloads, below is an overview of my sessions and their links.

Let me know what you use it for, I’m always interested!

Update 20090918: changed the download locations because CodeCentral messed up.
Read the rest of this entry »

Posted in .NET, ASCII, C#, C# 2.0, CodeRage, CommandLine, Conferences, CP437/OEM 437/PC-8, Database Development, Debugging, Delphi, Development, Encoding, Event, Firebird, InterBase, ISO-8859, ISO8859, Java, Prism, Software Development, Unicode, UTF-8, UTF8, Visual Studio and tools, XML, XML/XSD, XSD | 4 Comments »