Gunnar Peipman's ASP.NET blog
ASP.NET, C#, SharePoint, SQL Server and general software development topics.
-
SharePoint: How to display blog feed using XML Web Part?
I wanted to show our company's blog feed on our intranet first page. There some empty space I wanted to fill somehow. I found a good solution, so there was no need for some third-party Web Parts. Also there was no need to write any additional code.
-
Extension methods - how they look like after compiling
This blog entry is supposed to be the continuation for entry C# Extension Methods where I told what extension methods are and how to use them. This time I will tell about what they are behind the curtains. Do they really add new methods to current classes or not? I mean, are these methods really added to classes or are they something else?
-
How to connect Business Data Catalog (BDC) lists to other SharePoint lists
Recently I had to create Web Part connection between BDC based list and usual SharePoint list. BDC list was provider and usual SharePoint list was consumer. I was pretty surprised if found out that I was able to connect BDC based list only to other BDC based Web Parts. All the other Web Parts were not able to be consumers for them. Same time BDC lists were able to be consumers of the other web parts.
-
C# Extension Methods
One of new cool features that will be available in C# 3.0 are extension methods. Extension methods will allow us to extend existing classes with new functionality. In this example I will show you how to extend System.string with two methods that are very popular in PHP: nl2br() and md5().
-
C# automatic properties
C# 3.0 makes it very convenient to create properties that doesn't carry any functionalities besides returning value of attribute and assigning value to it. This new feature is called automatic properties.
-
Testing sorting algorithms
Some time ago I had to deal with sorting algorithms. Besides my main task I found a good way how to test custom sorting algorithms. This blog entry is one of early birds, more about sorting algorihtms is coming soon. Hopefully some time after TechEd 2007 for Developers. The procedure I wrote to test sorting algorithms is simple and works. Of course, I am always opened for better ideas if somebody wants to suggest some. Here's the little overview about what I've done.
-
How to create grayscale images on .NET
In this example we will use simple color recalculation method to grayscale images. For each pixel on image we will calculate "average color" that we write back on image. Average color is sum of current color's red, green and blue channels integer value divided by three. This value is assigned to all three channels for current pixel.
-
SQL-DMO and searching from meta-data
Lately I faced the need to search for specified strings in all stored procedures in given database. I found SQL-DMO library very useful for it. So, ten minutes later I had a simple form that fits my needs perfectly. And some minutes later I had there some more cool features. As a result I had form that enables me to search for strings from stored procedures, user defined functions and views. Also I was able to search strings from mentioned objects names. I tested it on a little bit larger MS SQL Server database, iterating approximately through 500 database objects and searching for given string and I mentioned no performance problems. So, here's the example.
-
MoreDefensiveDatasource
At the end of the previous month I wrote a posting on DefensiveDatasource class that can be used to associate ASP.NET's GridView with collections containing objects of different types and based on one and the same base class. Dividing data into pages in GridView does, however, not succeed. An error message "The data source does not support server-side data paging" is displayed.
-
Creating simple tasks calendar for SharePoint sidebar
I needed view of SharePoint calendar where I can see not accomplished activities from beginning of calendar until tomorrow. If you ask me why I needed something like this, there is a simple answer: this calendar contains almost everything that is going on (mainly different milestones and deadlines). As it is common calendar and everybody wants to see everything then there is no need for personalized filter. And there was one more requirement - there must be support for states of tasks describing if event is planned, done or canceled, so we can show in sidebar calendar only the planned tasks or events.