Skip to main content
  1. Tags/

Dotnet

Creating events using delegates

·2 mins

After promising you a post on using delegates to create events several times, I’m now using my break to post it. Because it will be a while if I wait until I can find the time… 😉

Creating events using delegates

·3 mins

Stored Procedures rule, because they facilitate manipulating the dataset you get from a database or the way you are inserting or deleting data in a database without changing your application. Or your business layer for that matter. But you can’t always use stored procedures for the actions you would like your application to take. Or maybe your database doesn’t support stored procedures. In that case it’s back to queries for you! And that’s what I would like to talk about… queries. And how to protect them.

Delegates explained

·2 mins

Delegates can be seen as interfaces for methods. Let’s look at an example of a delegate and what it really represents.

delegate double Calculation(double one, double two);

All this line of code really does, is tell the class it is in that there might be one or more methods with the given signature: a method returning a double and taking two doubles as parameters. You cannot call a method Calculation now, because it does not have a body, so it doesn’t have any functionality. It’s just a blueprint for future reference. You’re saying something like: “You might find one or more methods somewhere having this signature which do something for you, but don’t ask me where or what they are called. Just be ready!” Next, let us create a method with the same signature as the delegate.

C# XmlSerializer FileNotFound exception

·2 mins

When using XmlSerializer in .NET on a self-made class, you might receive the FileNotFound exception at runtime upon instantiating the serializer. You don’t get enough info to debug this problem, and the filename of the file it didn’t find can’t explain much either, because the dll-name is different ‘garbage’ every time.

ASP.NET 2.0

·2 mins

To be honest, I’m glad I’m not on an ASP.NET project right now. I saw ASP.NET 2.0 in action last Friday, and I would go crazy if I would have to do an ASP.NET 1.1 project now.
2.0 and the new Visual Studio 2005 (Whidbey) take a lot of ‘standard work’ out of the developers’ hands, making development much faster. It begins with something as simple as leaving the cursor where it is while switching between views. You’ve got button1 selected? Go to your HTML and the cursor is at the beginning of the button1 tag. In source view, select table3 and switch back to design view and, you guessed, table 3 is selected.

.NET eye opener

·1 min

Currently I’m reading the Microsoft Press book “Developing web applications with Microsoft Visual Basic .NET and C# .NET” by Jeff Webb. (This book is part of the very interesting “MCAD/MCSD Self-Paced Training Kit“.) I borrowed this book from the Microsoft Library here at my new job. They’ve got a very wide variety in books! Another plus to add to the list.