« Tsunami Animation | Main | A tale of two companies, and getting fired (or not) for blogging »
December 30, 2004
Whidbey/Yukon News
Wally B. McClure has been working with the scripter object in SMO. SMO (Server Management Objects, the replacement for DMO) lets you perform just about any administrative function on the database programmatically. In fact, supposodly, all of the Microsoft admin tools are being built on top of it, so you should have an API that lets you do anything the admin tools can do. One such feature is scripting changes made to the database. In what must have been some really dark days of development, Microsoft created a scripter object that does this. You create an instance of the scripter object, and then programmatically make all the changes you want to make, and then have the scripter object spit out the script that would perform those changes. The neat thing is, you don't actually have to commit those changes to the database to generate the script.
Jan Tielens points to an article on The Server Side about C# Anonymous Methods. Anonymous methods are really just syntax candy. You could do the same thing with traditional delegates and methods, but there's something that's just cool about the appearance of passing code to a method or constructor:
Thread thread = new Thread(delegate(){
Console.WriteLine("ThreadHashCode:{0} Hello",Thread.CurrentThread.GetHashCode());
});
Posted on December 30, 2004 at 05:03 PM | Permalink