.NET Network Programming
Filling DataSets with Multiple Tables

Code Snippets

I've added a new category to my weblog: Code Snippets.

Here I will show some code segments that generate special interest in my courses.

For example, one "homework" that I've given to my online students is that they should create a class to make this code happen:

Person p1 = new Person("Arnold", "Schwarzenegger");
p1.City = "Los Angeles";

Person p2 = new Person();
p2.FirstName = "Niki";
p2.LastName = "Lauda";

The interesting part follows here, custom formatting of the person objects:

Console.WriteLine("{0:Lastname}", p2);
Console.WriteLine("{0:Full}", p1);

The output should be:

Lauda
Arnold Schwarzenegger, Los Angeles

I will post the answer here after PDC, when the "homework" should be completed :-)

Christian 

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

Travis Laborde

did the dog eat the homework?

The comments to this entry are closed.