Great SQL Server Error
ALTER TABLE MYTABLE ALTER COLUMN TIMESTAMP varbinary(8) NULL
The following error is raised:
Cannot alter column ‘TIMESTAMP’ because it is ‘timestamp’.
You have to do the following:
ALTER TABLE MYTABLE DROP COLUMN TIMESTAMP
ALTER TABLE MYTABLE ADD TIMESTAMP varbinary(8) NULL
VS.NET Shortcuts
What is a Non-CLS Compliant Exeception and why should I care.
While investigating this I found the following article on how to implement a bulletprof main routine:
Sample of how to implement the main routine of an application.
Pop Quiz for Delphi developers : what is the most basic class that can be thrown as an exception?
The obvious answer of Exception is wrong – you can raise a TObject or descendant (TForm?)- just don’t expect your exception handers to work.
The .NET CLR has this great base Exception class.
So why do they need to allow anything else!
Why not define a ENonCLSException descendant and raise that!
It appears that IL allows a System.Object to be thrown in exactly the same way as Delphi!
The above link includes a sample of how do do this.
The moral of this tale is that your default exception handler needs to finish with a generic catch clause. I need to look into how to add my own template application to the defaults in VS.NET – some of these need to be created by default.
More usability issues
textBox2multiline.Text += System.Environment.NewLine + “This is a test”;
is far more code (and far less obvious) than:
memo1.lines.Add(‘This is a test’);
In addition when you rename a delphi control if the text property matches the control then the text property changes as well. I wonder if the designer could be extended that far? This makes editing controls much easier – first you rename them and then you customise that into the correct text. This is far more efficient.
Scott Hanselman's Ultimate Developer and Power Users Tools List
Collection of useful items
QuickCode.NET
log4net
NAnt
NUnit
CodeSmith
Reflector
NUnit add-in
SourceBrowse
Filemon
FxCop
SecondCopy
I intend to compile a list of other must-haves
Related is the DXHogHunt which identifies which directories on your machine are taking all of the space.
Ultimate Resource for .NET Namespaces
It links to newsgroup articles explaining the details required.
Replacement for ShellExecute
System.Diagnostics.Process.Start
This is much cleaner than the PInvoke version of:
[DllImport(“shell32.dll”)]
public static extern int ShellExecute(IntPtr hWnd,
string lpszOp, string lpszFile,
string lpszParams, string lpszDir,int FsShowCmd);
static void Main(string[] args)
{
int hWnd;
long noth;
ShellExecute(0, “OPEN”, @”D:\WINNT\NOTEPAD.EXE”,
null, null, 0);
}
Useability issues
The .NET Framework has a LinkLabel control. The purpose of this is to allow hyperlinks &c.
However there is no desgner for this. You have to add the associated links in code.
While this is flexible it is more difficult than necessary to use for the simple case. Borland would have implemented the designer here.
Borland’s big problem has been marketing and sales. Even when they have a superior product they cannot get the market to accept it. Of late they seem to be diversifying into earlier stages of the lifecycle – requirements (CaliberRM), design (Together and Bold) and configuration/planning (StarTeam). It is difficult to complete against the Microsoft Universal licence (allowing access to almost all the development tools for a fixed annual fee) – Microsoft make their money off of the server products that the customers require. Borland could launch a product as a Visual Studio extender – adding in the missing property editors.