devxlogo

Tip Bank

Extending the Existing CLR Type

Yes, you read that right. With .NET 3.0, you can extend any existing CLR type by adding one or more public methods to it?without recompiling the library. These new members

Get Proper Filtered Results from a Data View

Ever notice how your data isn’t filtered properly even though you’ve set the Row Filter Expression correctly? For example, suppose you have this code: DataView dv = ds.Tables[0].DefaultView; dv.RowFilter =”location=11″;

Passing Strings Between Delphi DLL and VBA

Unlike other routines, this one doesn’t need to pass the length of the returned string for later trimming in VBA. This is because the Delphi function also tricks VBA into

Make Your Mouse Pointer Tremble

To make your mouse pointer appear to be trembling, you first create a form with ScaleMode = 3 – Pixel. Then use the following code: Option ExplicitPrivate Type POINTAPI X

Using Explicit Casting to Display Data

Suppose you’ve retrieved data from a datasource and you want to display the value of field1. Normally, you’d do this by using the &lt%# DataBinder.Eval(Container.DataItem,”field1″) %&gt in the aspx/ascx file.

Validating an XML Document

The following code shows you how to use the DOMImplementationLS and DOMConfiguration classes to validate an XML document only when an XML Schema is present: DOMImplementationLS DOMiLS=null;//get a LSParserLSParser LSP=DOMiLS.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS,