Christian Nagel's OneNotes

.NET Training, Consulting, Coaching - C#, Web Services, Enterprise Services, ASP.NET, Whidbey, Longhorn and More!

Affiliations

Books I've written

INETA UG Leaders

My Blogroll

Browse by Tags

All Tags » Code Snippets (RSS)
Generic Methods
Following my blog about Generic Delegates and Anonymous Methods , here is more: Generics and anonymous methods can make code a lot more flexible. Following I show different ways to accumulate the balance of Account objects. The Account class is a simple...
Dispose and Finalize with C++/CLI, C# and VB
Depending on the .NET language more or less of implementing resource management with the interface IDisposable and the finalizer is hidden. Interestingly, with VB nothing is hidden - however all the code is created automatically with Visual Studio 2005...
C++/CLI and IDisposable
With my previous post about Instantiating Managed Objects with C++/CLI you could read about using ref types two different ways: with local variables and with a handle. Now I'm adding implementing the IDisposable interface with the Test class: ref class...
C++/CLI: Instantiating Managed Objects
C++/CLI (not Beta 1) allows declaring reference types as local variables. Let's start with this simple ref class: ref class Test { public: void Foo() { Console::WriteLine("Foo"); } }; Handles and the gcnew operator can be used to create instances: Test...
Creating Word Documents with XSLT (Part 2 - Creating Tables)
With my last blog about creating Word documents with XSLT I've shown an example to do a very simple document. Here I'm showing how to create a table using Word. The same XML file as before is used: <?xml version="1.0" encoding="utf-8" ?> <Courses>...
Documentation that shows up in the XML Editor
The XML Editor of Visual Studio 2005 shows the elements that are allowed according to the XML Schema. The editor not only shows the elements and attributes that are possible where the cursor is positioned, it also shows some documentation about the elements...
Creating Word Documents with XSLT
Using the Office Schemas it is easy to create Microsoft Word 2003 documents. Let's start with this XML document: <?xml version="1.0" encoding="utf-8" ?> <Courses> <Course Number="MS-2524"> <Title>XML Web Services Programming<...
XSLT: Converting multiple elements to one attribute
I've received a question how to convert multiple XML elements to a values for a single attribute. Here is the information about how this can be done with XSLT. The XML source: <Article> <Head> <Title>.NET Enterprise Services</Title>...
Interface Inheritance
Memi Lavi writes about inherits vs. implements in C# , and that the difference gets much more obvious with VB. He also talks about multiple inheritance with interfaces is not possible. Mostly I'm writing my programs with C# (sometimes C++ and VB). Now...
.NET 2.0: Database Independent ADO.NET
.NET 2 has new factories that makes it easier to write data-programs independent of the databsae. With .NET 1.0, we could program independent of the database using interfaces: IDbConnection connection = new SqlConnection(connectionString); IDbCommand...
More Posts Next page »