Implement custom events in .NET framework

Hello everyone, In today’s post I would like to explain how to create .NET custom events. The .NET framework provides specific objects that enables simple creation and use of events.The events allow to an object (or class) to let know other classes or other objects when a specific occurrence occurred. The class that generates and sends the event is called Publisher...

Read more

C# features

Since version 3.0 of C# some features that make writing classes and common methods simpler and concise have introduced. In this post we talk about automatic properties and object initializers. AUTOMATIC PROPERTIES The automatic properties (or auto-implemented properties) are nothing more than a compact syntax for writing the properties of a class. They allow you to write code like 123public String name {get; set;} public DateTime birthday {get; set;} that will be...

Read more

Connect a Dataset instantiaded by code to a CrystalReport reporting tool

Hi all, In today’s post I want to introduce a simple method for attaching DataSet objects, instantiated in our code, to CrystalReport 2008 reporting tool. CrystalReport is a powerful tool that allows you to easily create reports on data processed in our .NET applications. The following steps are used to create the reports of a dataset created in our application: 1. First of all, add a new Form to our VisualStudio project. This form will be used to show the repo...

Read more

LINQ: serialize C# classes

The version 3.5 of Microsoft’s .NET Framework introudced the LINQ (Language Integrated Query).component.LINQ is a SQL-like language that allows to query different source of data, as objects, xml files and databases.What i’ll show today is how to generate an xml rappresentation of a C# class instance..Suppose to have a C# class Book so defined.123456public class Book { public String title { get; set; } public String au...

Read more