Archives
-
SharePoint jQuery deployment feature
After reading Jan Tielen's blog entries Integrating SharePoint 2007 and jQuery Part One and Part Two I wrote a simple SharePoint solution on Visual Studio 2008 that installs jQuery scripts to SharePoint.
-
Access denied error when crawling SharePoint content
One nice day I discovered that MOSS2007 search site didn't work anymore on test server. Well, the only thing that worked was indexing on file system level. But SharePoint content indexing was out of order. I found some information from web about this issue. Specially helpful may be blog entry Access denied when crawling MOSS Content by Sven Gillis. But it was only part of solution.
-
Authenticating programmatically to Exchange Server 2003 FBA
In one of my projects I had to read data from Exchange Server 2003 programmatically. I had access to Outlook Web Access that used Form Based Authentication (FBA). After some hacking and testing I got authentication part of my utility work. The point was easy - before making WebDAV requests to Exchange Server we need authentication cookies, so there is active session we can use.
-
<asp:Chart>
Scott Guthrie had some good news almost week ago - there is new charting component for ASP.NET available now. Component is made by Microsoft and it is free to download. This component fills one important hole in ASP.NET components gallery. We have now very powerful charting component that is highly customizable and configurable. There is also available chart control add-on for Visual Studio 2008.
-
Three signals of death march projects
Death march projects are standard in software development and they are usually the most complex ones to handle. It seems to me that this is more like question how to handle the chaos and how to survive it with as less losses as prossible. There are some signals of dangers I would like to share with you.
-
TechEd 2008 Developers - Microsoft data center in Chicago
Although I'm hardware guy I heard some interesting facts about Microsoft data center in Chicago I want to share with you. As I understood this data center will run also Azure services, so it may also be interesting to see some non-official estimates about how much applications can run in this center.
-
TechEd 2008 Developers - Workflow Foundation 4.0
Windows WorkFlow Foundation 4.0 has some new cool things to offer. I visited one of David Chappell sessions where he told us about "Dublin", "Oslo" and WF 4.0. It was very interesting session and I got all information I expected.
-
TechEd 2008 Developers - How to start testing
I visited Roy Osherove session at TechEd 2008 Developers (EMEA) where he spoke about how and why to test software. There was nothing new to me besides couple of things but I want to give you a little overview about the most painful topic for companies and developers - how to start testing. It was the best part of session I think and that's why I decided to blog about it.
-
TechEd 2008 - I'll be there
Developers! Developers! Developers! TechEd 2008 EMEA for developers is coming and I am glad to announce that I'll be there with all developers from my little company. I hope you are there too! :)
-
Expert .NET 2.0 IL Assembler
-
SharePoint for Developers: 3.3 Hands-on - querying lists
The best way to get data from SharePoint lists is to query them. Using queries you guarantee that only list items you really need are retrieved from database and constructed to objects by SharePoint. Most of the time you don't need the full collection of list items, so it is not point to ask all the items and then use only few of these. Let's see how we can query SharePoint lists.
-
I am MVP
Just wanted to let you know that I got phone call yesterday evening by Microsoft representative who was happy to say that I am new MVP (ASP.NET). I also got some e-mails from my region's MVP lead. huh, it is all new to me and I have had no time to check out everything that MVP program has to offer. But there is hell load things learn about new possibilities.
-
SharePoint for Developers: 3.2 Hands-on - getting list items
To read data from list we have to get reference to list first. SPWeb has lists collection we can use to find the list we are interested in. Following code example shows how to get instance of list.
-
ForEach method and blonde me
I want to tell you about List<T>.ForEach method and one of my famous blonde moments when I was debugging faulty code. LINQ makes it easy to query collections and that's why I like it a lot. Today is friday and weekend is coming. Let's relax and have some fun on me. Here's one proof how n00b I can be :)
-
ProBlogger
Recently I readed a book titled as ProBlogger: Secrets Blogging Your Way to a Six-Figure Income. Authors of this book are Darren Rowse and Chris Garrett - the veterans of commercial blogging business. Darren is also owner of the famous ProBlogger site and b5media.
-
Professional SharePoint 2007 Web Content Management Development
-
Developer bookshelf
Here you can find the list of books I have read. All these books are recommended ones, here are no titles I don't suggest. Click on book images to read reviews written by me.
-
DocumentShow extension for SharePoint
We finished today one interesting SharePoint extension. We call it DocumentShow extension and it allows you to show HTML files in document library as slide show. In our case the customer wanted to show some reports on large LCD screen located in one of his office rooms.
-
SharePoint for Developers: 3.1 Hands-on - connecting to SharePoint and using elevated rights
In previous post of this serie, SharePoint for Developers: 3. Introduction to SharePoint Data Structures, I described some basic points of SharePoint data structures. In this post we will see how to use these data structures and how to create custom field types. The next hands-on post will stop on custom field type and it will give you very good example about how fields work in SharePoint.
-
SharePoint for Developers
SharePoint for Developers is serie of blog entries that introduces SharePoint development topics to ASP.NET developers. This serie is supposed to be from-developer-to-developer serie and I hope it helps many other developers to get better understanding of SharePoint and its internals.
-
Top Stories
Here you can find references to most popular content in this blog.
-
SharePoint for Developers: 3. Introduction to SharePoint Data Structures
Data in SharePoint is different than in our usual object-oriented applications. If we want to deal with data in SharePoint we have to understand how data is organized there. This is one of the key points to successful SharePoint projects.
-
SharePoint for Developers: 2. Development Environment
Before going to deep dive let's put up development environment. In this blog entry I will tell you how to put everything up and what tools we are using for which tasks. Well, if you read further then you have something to do for couple of evenings. Let's start!
-
ASP.NET Dynamic Data
ASP.NET Dynamic Data is one of those technologies I have been keeping eye on. With .Net 3.5 and Visual Studio 2008 SP1 is fully available. Let's see how it works and how we can use it.
-
SharePoint for Developers: 1. Introduction
This is the first entry of my SharePoint for Developers serie. I asked from developers if they need something like this and they said yes. First entry is introduction and after reading it you will understand where SharePoint stands and what kind of problems it tries to solve.
-
Implementation Patterns
-
Professional SharePoint 2007 Development
-
Question to SharePoint developers
-
GridView or Repeater?
What is the difference between GridView and Repeater? This is one of the most common questions that beginners ask when they are trying to get familiar with data bound controls. Both of these controls have their own using context and I try to explain when one should use GridView and when it is okay to use Repeater.
-
Some points about services layer
Some time ago I introduced here book titled as "Domain Driven Design". One concept this book described was Services Layer. Okay, there were some other layers too but I want to stop at services layer this time :)
-
How to become a good developer?
I was asked through this blog how to become a good developers. I think this is the question that many beginners want to ask. For every question there are throusands of answers. Okay, there are many answers like these but these ones are mine. :)
-
Too-Smart-Business-Object Anti-Pattern
Building up a good business library is art. Because every bad decision made early will eat project's time later. Bad decisions will also waste many time of developers who have to use this library in their work. One of the most common mistakes made is mixing DAL functionality to business objects. At first it may seems like a good idea - why not have a smart objects? - but as project goes this solution causes more and more problems. And, be warned, each next problem is worst than previous.
-
Avoiding exceptions using list controls
Avoiding excpetions is always a good practice because exceptions can hurt as when thay occure. They may cause also hard performance loss. Assigning selected value to list controls is one candidate for ArgumentOutOfRange exceptions. Often this problem is solved using unhandled exception:
-
DTO - not only for web services
Usually developers think that DTO (Data Transfer Object) is something related to web services where data serialization is required to move data from one point of network to another. It is clear that in most cases there is no point to move complex data structures over network when client side needs this data in pretty simple form. That's why DTOs are created - they are simple, easily serializable and there is no data that client side doesn't need. But there are also other DTOs you may find useful.
-
Sometimes integration tests are more important
There are some cases when integration tests are more protective than unit tests. Of course, there is no reason to compare these two kinds of tests but if we have to write them we have to set priorities and think what problems may arise during development. One special case when it is important to have integration tests early in place is when we are using O/R-mappers.
-
Some extension methods for DateTime
During one of my current projects I wrote some useful extension methods for DateTime class. I had to write custom calendar component and therefore I needed manipulate dates a little bit. Here is some extensions I would like to share with you. And, of course, comments and suggestions are welcome as always.
-
Domain Driven Design
-
Silver bullet anti-pattern
I will continue my little serie about anti-patterns of decisions and activities that may screw up projects and make developers (and why not also others) life hell. Now let's look at silver bullet anti-pattern. It is about using unknown tools and technologies in the place where one shouldn't never do that.
-
How I use Hungarian notation?
Well, this post is not my attempt to start millionth flae war about variable naming conventions. It is my explanation how I use Hungarian notation and why. By the way I am not dedicated fan of any convention, so starting flaming here has no point. So let's see why and how I use Hungarian notation.
-
var is like (good) wine
Keyword var is cool thing we can use to make our code more readable for other programmers and why not - reviewers. But var can also be used to make our code difficult to understand. In this case, lte's say, we are overusing var. So, var is like wine - if one takes glass of it then everything is okay in the morning, but if somebody takes it couple of bottles then the morning will be awful. Or let's say - too much var will kill you?
-
I-Don't-Care Anti-Pattern
It is easy to find articles and blog entries about patterns, design and good practices. But there are not so much information about anti-patterns. One of the worst anti-patterns is what I call I-Don't-Care Anti-Pattern.
-
Response.Redirect and Response.End
I discovered once myself automatically writing redirects like this:
-
70-542 - Done!
Couple of days ago I had 70-542 Microsoft Office SharePoint Server 2007 - Application Development exam. It wasn't one of easiest exams I have ever had but now it is done and I am certified SharePoint developer. :)
-
Code Complete 2
-
Interface for Processes
I had to write one data import/export utility that moved data from one database to another. Once I was finished the first round of coding I found one thing that needed refactoring - the import/export process wasn't generalized. It was part of importer/exporter utility main class (it was console application). After some refactoring I got some common things to use in other tasks like this.
-
Don't Make Me Think
Don't Make Me Think by Steve Krug is the definitive guide to user friendly web pages. This book doesn't tell you about how to make HTML pages or how to design them. This book tells you what to keep in mind when dealing with web pages and how to make your web pages user friendly.
-
GridView and Invalid CurrentPageIndex Value Exception - .Net 3.5 Version
In my previous GridView entry titled as GridView and Invalid CurrentPageIndex Value Exception I made an example about how to corrigate paged GridView page index before grid is bound to data. Let's to id now .Net Framework 3.5 way.
-
Basic ASP.NET SEO
SEO is popular topic nowadays and as ASP.NET is growing its popularity also as platform for public systems. Therefore SEO is going to be more important topic also for ASP.NET developers. The world of SEO is always in rapid change - can you imagine that last year Google published 450 updates to it's search engine algorithms? Although the field is changing fast there are some key points that has been fundamental and unchanged this far. Let's see what is the minimum you should do and how you can make your sites more SEO friendly on ASP.NET.
-
GridView and Invalid CurrentPageIndex Value Exception
There are many developers who have faced the page index problems using GridView. Specially, if GridView supports deleting. Also one may face page index going out of range when there are multiple users managing same data. Here is my little advice about how to avoid page index problems when using GridView.
-
C# and Partial Classes
.Net 2.0 provided us with new feature called partial classes. Using partial classes we can use multiple files to keep the code of same class. Yes - we can put some methods to one file and the others to another file. Although partial classes may be extremely useful they can be also used to ruin system's technical design if developers don't know what happens behind the compiler.
-
Building Object Applications That Work
-
Working Effectively with Legacy Code
-
SharePoint on Vista
Famous SharePoint features developing company Bamboo Solutions has created installer for Windows SharePoint Services 3.0 SP1 that install WSS3.0 on Windows Vista. The solution allows developers to create SharePoint solutions on their own machines. The need for virtual machine is still there, so don't hope you can avoid them.
-
C# and anonymous types
One cool feature of C# 3.0 is support of anonymous types. Let's suppose we have to create some data structure and we need this structure in one place in one method. This far we had to create a new private class or structure. With anonymous types we don't have to define new type - we can create it on the run.
-
C# and var keyword
C# 3.0 introduced us new language feature: type inference using keyword var. Some guys think that var in C# is same thing as var in PHP. That's wrong - var keyword in C# is totally different thing and it doesn't mean that C# has now support for type changing class attributes. Let's prove it.
-
Behind the Compiler
"What will happen behind compiler?" is my favourite questsion when dealing with technical design and coding. There are many cool and powerful things we can use to be more productive, faster and better. We have automatic properties, extension methods, partial classes, generics and so on. If we don't know what they are and how these things are handled by compiler we may face serious troubles later.
-
Using parent page properties in user control
There may be situations when we need to use parent page properties from user control. I know, this situations is a warning sign - there's something wrong with UI structure if user controls should know their parents. So, how to get correct reference to parent page so we can use also custom properties defined there?
-
Filtering dropdown by value selected from another dropdown
This is the first posting of Beginners section of this blog. I will put here code samples that are not advanced enough to put them elsewhere in this blog. First example shows how to filter one dropdown list based on value selected from another.
-
Pager class
Once I wrote a class to make paging calculations. I had some data bound user controls that had no paging support. So I had to improvise. As it is was pointless to duplicate pager code to every user control where I needed paging I wrote a class to make my life easier.
-
Getting distinct values from arrays (through .NET Framework history)
Getting distinct values from arrays is not a unique problem. Here will I show some options how to do it. We are will use array of integer in examples here. This blog entry shows you somehow the mighty evolution of .Net Framework.
-
SharePoint: Assigning values to DateTime fields
SharePoint list items have a tricky way how to assign values to DateTime fields in your code. It is possible to assign value of DateTime type to this field but it also possible to assign a string. This string is a little bit mysterious. You may get errors with one dates but some dates will work perfect. So what's the trick?
-
ASP.NET Search Sitemaps - something for SEO
ASP.NET Futures introduced support for search engine sitemaps. This is content detection protocol introduced originally by Google and later accepted also by Microsoft and Yahoo! ASP.NET makes sitemaps generating easy for us and as a bonus their model is perfect for more complex web applications like e-commerce and e-services sites. Let's see now what we can do.
-
Extension method for enumerators
Extensions methods are pretty powerful thing because we can extend existing types without inheriting from them. I don't know developers who want to extend string or int or other basic types offered by .Net Framework.
-
SharePoint: Half-Initialized Folders
I discovered something weird when trying to detect document library folder by URL. It is possible to create folder objects that are half initialized. I tried to ask folder by URL and I used URL of documents list view. The result - folder with correct name etc but many parameters were missing.
-
SQL Server 2008 Reporting Services - save your time!
Some time ago I tried out SQL Server 2008 Reporting Services and I was amazed. I'm serious MS Paint terrorist and nice pictures are not one of my strong skills. So, if something makes things look nice to me I'm very happy.
-
SharePoint: Save performance when getting list items
Another day, another solved mystery. Developers have interesting lifes as long as there are problems to solve. Another surprise from SharePoint - how to bog server down using only couple of lines of code? Of course, I have solution too that eliminates the issue.
-
Why MOSS2007 Content Import Fails?
-
Unity and singletons
I just putted up Unity behind my test project and had some troubles with singletons. There is some misleading information in documentation you should be aware of. I created one class and one interface, both in same project to save some time.
-
SharePoint import ruins create and modification dates
When exporting and importing data between SharePoint Server 2007 webs I found interesting bug - item creation and last modification dates will be lost during import. Example - document is created at 05.04.2008. After import I checked out data in manifest.xml. Everything seemed to be correct - also modification and creation dates of documents. After export these dates are incorrect. Instead of original dates I can see date and time of export instead of original dates. Dirty guy as I am I also sniffed around in SharePoint database - I saw correct dates there! But when looking my document library through browser I saw incorrect dates. Does anybody know what is the problem? Is it bug and is there any workaround to this problem?
-
SharePoint: Changing comments of document versions in code
During one SharePoint migration project I had problem with document versions comments. I needed some way to set these in my code. As I didn't found any normal way to do it through SharePoint API I worked out something I call dirty hack. But it works.
-
How to bulletproof the loops
Here is one example about how to bulletproof the loops. This example holds well for legacy code and - of course - for hurry-written-code (that might be the current one, unfortunately).
-
Using Version Class
When dealing with version numbers we often need to convert them to string and vice versa. There is lot of code where versions are handled manually in code. I don't know why. But I know for sure there is class called Version and I'm sure this class will help us a lot.
-
How to Update SharePoint List Items without Creating New Versions
Migrating data from SP2001 to MOSS2007 is fun - if you know what I mean. During migration we discovered that migration tool has some serious bugs. I wrote some code that fixes some problems after importing process. There I found a problem - I needed to update list items without getting new versions of them after updates. Usually we see samples like this in internet:
-
Is Automatic Property Same as Property?
I was listening one session on TechEd (night after long party, yeah) and I was thinking about automatic properties - are they really exact equivalent to usual properties? Something made me suspicious, so I opened my laptop at first free moment and checked out what's going on.
-
Windows Installer and Extensibility.dll
Windows Installer is one of my favorite problem childs - of course, when it has mysteriuos problems. I found a problem when installing Outlook add-in on machine that has no extensibility features installed on it. Something was missing and installer gave me the famous "Unable to get installer types" error. After pointless waste of time tracing installer and checking its logs I checked out what's going on in file system.
-
Some cool SQL Server user names
One day when I checked SQL Server messages in Event Viewer I found a long series of unsuccessfull attacks. Somebody desperately tried to guess user names and passwords.
-
C# and question marks
One cool operators that C# offers us is ?? But before ?? we should know what does ? after variable type name. So, let's take both of these question marks and let's see what they are. Also let's jump for a while behind compilator to see IL code that compiler produces.
-
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.