This c# and c# net site aims to provide book reviews and free ebook on c# datagrid, c# array, c# xml, msdn c#, c# application, c# example, c# form, c# sample, c# programming, asp net c#,c# database, c# console, c# library, c# file, c# enum, c# switch and c# code, etc.

A Comprehensive Guide to C# and the .NET Platform

©2001 Andrew Troelsen
Advanced C# Class Construction Techniques
c-sharpcorner.com
This chapter rounds out your introduction to the core aspects of the C# language by examining a number of advanced (but extremely useful) syntactic constructs. To begin, you learn how to construct and use an indexer method. This C# mechanism enables you to build custom types, which exposes internal subtypes using the familiar bracket operator (i.e., []). If you have a C++ background, you will find that creating a C# indexer method is analogous to overloading the [] operator on a C++ class. Once you learn how to build an indexer, you then examine how to overload various operators (+, -, <, > and so forth) for a custom C# type.
This chapter then examines three techniques that enable the objects in your system to engage in bidirectional communications. First, you learn about the C# “delegate” keyword, which is little more than a type-safe function pointer. Once you learn how to create and manipulate delegates, you are in a perfect position to investigate the .NET event protocol, which is based on the delegation model. Finally, you discover how the use of custom interfaces can also enable bidirectional communications (which should ring a bell for those coming from a COM background).
I wrap up by examining how you can document your types using XML attributes, and how the Visual Studio.NET IDE automatically generates Web-based documentation for your projects. Although this might not qualify as a truly “advanced” technique, it is a high note on which to end the chapter.

A Programmer’s Introduction to C#, Second Edition

By Eric Gunnerson
apress.com
IN MOST PROGRAMMING LANGUAGES, some information is expressed through declaration, and other information is expressed through code. For example, in the following class member declaration
public int Test;
the compiler and runtime will reserve space for an integer variable and set its protection so that it is visible everywhere. This is an example of declarative information; it’s nice because of the economy of expression and because the compiler handles the details for us.
Typically, the types of declarative information are predefined by the language designer and can’t be extended by users of the language. A user who wants to associate a specific database field with a field of a class, for example, must invent a way of expressing that relationship in the language, a way of storing the relationship, and a way of accessing the information at runtime. In a language like C++, a macro might be defined that stores the information in a field that is part of the object. Such schemes work, but they’re error-prone and not generalized. They’re also ugly.
The .NET Runtime supports attributes, which are merely annotations that are placed on elements of source code, such as classes, members, parameters, etc. Attributes can be used to change the behavior of the runtime, provide transaction information about an object, or convey organizational information to a designer. The attribute information is stored with the metadata of the element and can be easily retrieved at runtime through a process known as reflection.
C# uses a conditional attribute to control when member functions are called. A use for the conditional attribute would look like this:
using System.Diagnostics;
class Test
{
[Conditional("DEBUG")]
public void Validate()
{
}
}
Most programmers will use predefined attributes much more often than writing an attribute class.........

User Interfaces in C#: Windows Forms and Custom Controls

By Matthew Macdonald
Custom controls are a key theme in .NET development. They can help your programming style by improving encapsulation, simplifying a programming model, and making user interface more “pluggable” (i.e., making it easier to swap out one control and replace it with a completely different one without rewriting your form code). Of course, custom controls can have other benefits, including the ability to transform a generic window into a state-of-the-art modern interface. Generally, developers tackle custom control development for one of three reasons:
  • To create controls that abstract away unimportant details and are tailored for a specific type of data. You saw this model in Chapter 6 with custom ListView and TreeView examples.
  • To create controls that provide entirely new functionality, or just combine existing UI elements in a unique way. An example of this is the directory browser control developed in this chapter.
  • To create controls with a distinct original look, or ones that mimic popular controls in professional applications (like Microsoft’s Outlook bar) that aren’t available to the masses. This topic is considered briefly in this chapter, and returned to in Chapter 13, with GDI+.

Creating custom controls in .NET is far easier than it has been in languages like C++ or VB, where you typically need to embrace the ActiveX model to create a truly shareable component. As most developers have found, ActiveX controls can be difficult to distribute because every version needs to be registered. Creating ActiveX controls also requires a bit of wizardry, with special care taken to handle property pages, design-time versus runtime appearance, and state management.

In .NET, creating a custom control is as easy as creating an ordinary class. You simply inherit from the best possible ancestor and add the specific features you need. Best of all, you can create a custom control class as part of an existing project, and then decide later to place it in a separate assembly that can be shared with other programmers.

This chapter introduces the different types of custom controls, and the types of problems they can solve. You will look at several key examples, including a thumbnail image viewer and a masked text box, and consider advanced techniques like creating multithreaded controls. However, you won’t learn how to make these controls behave happily in Visual Studio .NET. That topic, as well other issues like control distribution and licensing, are picked up in the next chapter.

Click to Read More/Download

User Interfaces in C#: Windows Forms and Custom Controls

Draft C# Language Specification

March 2001
Internal Working Document Released for informational purposes only
ECMA TC39/TG2
Microsoft
This ECMA Standard is based on a submission from Hewlett-Packard, Intel, and Microsoft, that described a language called C#, which was developed within Microsoft. The principal inventors of this language were Anders Hejlsberg, Scott Wiltamuth, and Peter Golde. The first widely distributed implementation of C# was released by Microsoft in July, 2000, as part of its .NET Framework initiative.
ECMA committee TC39 Task Group 2 (TG2) was formed in September, 2000, to produce a standard for C#. Another committee, TG3, was also formed at that time to produce a standard for a library and execution environment called Common Language Infrastructure (CLI). (CLI is based on a subset of the .NET Framework.) Although Microsoft.s implementation of C# relies on CLI for library and runtime support, other implementations of C# need not, provided they support an alternate way of getting at the minimum CLI features required by this C# standard.
As the definition of C# evolved, the goals used in its design were as follows:
  • C# is intended to be a simple, modern, general-purpose, object-oriented programming language.
  • The language, and implementations thereof, should provide support for software engineering principles such as strong type checking, array bounds checking, attempts to use uninitialized variables, automatic garbage collection, and so on. Program robustness, durability, and programmer productivity are important.
  • The language is intended for use in developing software components suitable for deployment in distributed environments.
  • Source code portability is very important, as is programmer portability, especially for those programmers already familiar with C and C++.
  • Support for internationalization is very important.
  • C# is intended to be suitable for writing programs for both hosted and embedded systems, ranging from the very large that use sophisticated operating systems, down to the very small having dedicated functions.
  • Although C# programs are intended to be economical with regards to memory and processing power requirements, the language was not intended to compete directly on performance and size with C or assembly language.

The development of this standard started in November, 2000. It is intended that the final version of this draft ECMA Standard will be submitted to ISO/IEC JTC 1 for adoption under its fast-track procedure. It is expected there will be future revisions to this standard, primarily to add new functionality.

Click to Read more/Download

Sams Teach Yourself C# in 24 Hours

By James Foxall and Wendy Haro-Chun
With Microsoft's introduction of the .NET platform, a new, exciting programming language was born. C# is the language of choice for developing on the .NET platform, and Microsoft has even written a majority of the .NET Framework using C#. C# is a modern object-oriented language designed and developed from the ground up with a best-of-breed mentality, implementing and expanding on the best features and functions found in other languages. C# combines the power and flexibility of C++ with the simplicity of Visual Basic.
This book is divided into five parts, each of which focuses on a different aspect of developing applications with C#. These parts generally follow the flow of tasks you'll perform as you begin creating your own programs using C#. I recommend that you read them in the order in which they appear.
Part I The Visual Studio Environment teaches you about the Visual Studio's C# development environment, including how to navigate and access 'numerous tools. In addition, you'll learn some key development concepts such as objects, collections, and events.
Part II Building a User Interface shows you how to build attractive and functional user interfaces. In this part, you'll learn about forms and controlsthe user-interface elements such as text boxes and list boxes.
Part III Making Things HappenProgramming! teaches you the nuts and bolts of C# programmingand there's a lot to learn. You'll discover how to create methods, as well has how to store data, perform loops, and make decisions in code. After you've learned the core programming skills, you'll move into object-oriented programming and debugging applications.
Part IV Working with Data introduces you to working with a database and shows you how to automate external applications such as Word and Excel. In addition, this part teaches you how to manipulate a user's file system.
Part V Deploying Solutions and Beyond shows you how to distribute an application that you've created to an end user's computer. Then, the focus is brought back a bit to take a look at Web programming and Microsoft's .NET initiative from a higher, less-technical level.

Dissecting a C# Application: Inside SharpDevelop

Copyright Apress
Learn advanced .NET programming techniques by getting an insiders' look at a complete application!
The developers who created SharpDevelop give you an inside track on application development with a guided tour of the source code for SharpDevelop. They will show you the most important code features and explain how you can use these techniques in your own projects.
You will gain valuable experience of building an application on this scale, learning from the decisions, mistakes, problems and solutions that lead to the current version on SharpDevelop. The SharpDevelop team will show you how to:
  • Build a highly modular application
  • Provide a flexible, extendable, customizable user interface
  • Manage the efforts of translators for efficient internationalization
  • Represent and manipulate text efficiently
  • Code search and replace functionality
  • Construct reusable controls
  • Implement a parser to provide syntax highlighting and auto-completion as users type
  • Use reflection to access information about .NET classes
  • Create a Windows Forms designer
  • Generate code programmatically

Click to Read More

Data Structures and Algorithms with Object-Oriented Design Patterns in C#

Author: Bruno R. Preiss, B.A.Sc., M.A.Sc. Ph.D., P.Eng.
This book is about the fundamentals of data structures and algorithms--the basic elements from which large and complex software artifacts are built. To develop a solid understanding of a data structure requires three things: First, you must learn how the information is arranged in the memory of the computer. Second, you must become familiar with the algorithms for manipulating the information contained in the data structure. And third, you must understand the performance characteristics of the data structure so that when called upon to select a suitable data structure for a particular application, you are able to make an appropriate decision.
This book also illustrates object-oriented design and it promotes the use of common, object-oriented design patterns. The algorithms and data structures in the book are presented in the C# programming language. Virtually all the data structures are presented in the context of a single class hierarchy. This commitment to a single design allows the programs presented in the later chapters to build upon the programs presented in the earlier chapters.
This book does not teach the basics of programming. It is assumed that you have taken an introductory course in programming and that you have learned how to write a program in C#. That is, you have learned the rules of C# syntax and you have learned how to put together C# statements in order to solve rudimentary programming problems. The following paragraphs describe more fully aspects of programming in C# with which you should be familiar.
  1. Variables
  2. Value Types and Reference Types
  3. Parameter Passing
  4. Classes and Objects
  5. Inheritance
  6. Interfaces and Polymorphism
  7. Other Features

Click to Read More

Basic C# exposure

Authors: Vijay Mukhi, Sandeep Shanbhag, Sonal Mukhi
Welcome to the first installment on a series of 12 volumes dedicated to the latest technology to hit the third rock from the sun. But before diving in and getting both feet wet, a wee bit of background.
Microsoft has always had a habit of doing things in style. Whether it was the basic yet robust Disk Operating System (DOS) or the (user-friendly?) Windows Operating System, Microsoft has always managed to rewrite the rules in the computer world. In fact it won't be exaggeration to say that today it is thanks to the efforts of Microsoft and the vision of its founder, Bill Gates, that it is software and not machines, that occupy centrestage. But then that is another story altogether.
Notwithstanding its hegemony over operating systems, it must be said that Microsoft took its time to wake up to the call of the Internet. Netscape was way ahead in the race, and Internet Explorer was a distant follower, almost nowhere in the reckoning. Even as users had begun to write off Microsoft as a non-starter for the web, it has gone and done what he does best ---pounced back with technology that is more cutting edge than its peers.
Although, Netscape isn't history as yet, most people would rather use a browser that works better with the latest versions of Windows. Internet Explorer literally chooses itself. Then of course there are other utility tools like Excel, Word and Power Point - all Microsoft-owned and near-indispensable.
And now Microsoft has come out with Microsoft.Net, a project until recently called Microsoft's Next Generation Windows Services architecture. The objective is the integration of the Internet - to offer software - like Word and Excel - through your browser on the computer as well as on a range of devices such as the mobile phone and the personal digital assistant (Palm Pilot etc).
The grand design, as it were, is to change the very nature of the way people work presently. Today we generally use one computer per person. Soon, all we shall be using would be only the Internet. For all our needs. In other words, whenever you switch your computer on, you would be connected directly to the Internet and not your hard disk for even the most rudimentary of tasks.
The task is enormous: every package now on offer will need additional code (even recoding). In the new regime, Microsoft has got Visual Studio .Net which can enable even the most uninitiated to design complex websites provided of course one is web and design savvy.
And all of this will be made possible through a new programming language called C# (pronounced C-Sharp).
Why C-Sharp?
When people talk of computer programming languages, there is always a debate on which one is better. C++, Java, Perl, PHP3… the arguments and counter-points can be endless. However, it is our considered belief that that C# would be in a sense better than the rest. And there is a reason for this.
Normally, whenever a new product is introduced, it betters the technologies of its ilk. For existing technologies evolve with their own pros and cons. Therefore, in 1995, when Sun introduced Java, it took the best from amongst all languages and added current technology. Now Microsoft has done the same. Its taken the best features from C++ and Java and morphed them into this new programming language called C#.
Imagine those who worked on Java when it was launched six years ago. Today a CV boasting of a six-year experience in Java means the maximum possible. Simple arithmetic - Java was launched only in '95. Similarly, if you get into C# today, only a Microsoft engineer could have more working knowledge of it! Therefore, we don't think we need to elaborate further on the weight that a CV with C# exposure would command! Think for yourself. You may know of people who have struck lucky in getting a job. But when it comes to keeping it, Lady Luck is powerless.
Indeed, technology is ruthless, in that, it breaks across all age and seniority barriers. That's the reason why even a teenager could have as much experience with a new technology as a 40-year-old. Unfair, but true.
Who should read this book?
Anyone wanting to be on the cutting edge of new technology. The book is written assuming no prior programming knowledge on the part of the readers. However, we make certain other assumptions that we shall explain now.
Many a times, on a clear night when we look up at the stars, we can't help but wonder whether there is intelligent life out there - or are they just like us?
For we don't believe that intellect is a quality that we are born with. In fact we are going to share a secret with you. It is the secret of success given to us by an old gypsy woman. This magic mantra has worked with many and we assume you would also use it in your life. In fact this is the only assumption we make in this book.
The secret is in persistence - nothing in the world can take place of persistence. Talent will not, nothing is more common than unsuccessful people with talent. Genius will not, unrewarded genius is almost a proverb. Education will not, the world is full of educated derelicts. Persistence and determination alone are omnipotent. We hope you agree with the old gypsy apply the maxim while learning C#.
Now, the mere fact that you are reading this means that you are interested in learning something new. However, there is a great deal of difference between a person who wants to read a book and the person who just wants a book to read. We hope you belong to the former category.
Though we attempt to infuse a certain degree of humour in our writing, please do not buy this book for its jokes. This is no coffee table book or even bedtime reading. This is a book, a medium, which we hope will do the serious job of teaching the reader a new programming language.
And how do we propose to go about it? Just like when you eat, no matter how delicious the food in front of you is, you have to consume it, one mouthful at a time. You just cannot eat it all at once, can you?
Similarly, when learning, it is always better to take small steps - one concept at a time. Sometimes, we even repeat the same concept several times, in different ways. For we firmly believe that if you do the little things well enough, big things will come to you asking to be done.
Incidentally, the entire C# software is available on the Microsoft site, downloadable free of charge. Detailed instructions are given on the site along with a set of FAQs.
Well, that's that. We agree, it is tough to climb the ladder of success, especially if you're trying to keep your nose to the grindstone, your shoulders to the wheel, your eye on the ball and your ear to the ground. Precisely the reason why some people do not recognise opportunity - it often comes disguised as hard work.
This book presents you with precisely such an opportunity. We hope you grab it with both hands!

Fascinating concepts about C# classes

Authors: Vijay Mukhi, Vinay Kalantri and Sonal Mukhi
This book presents myriad fascinating concepts about C# classes. It is classified into three sections, with each of them converging on distinct facets of classes available in the .Net framework.
The curtains are raised with the chapter on Threads in Section I, which presents a nascent introduction to this topic. The topics of Events and Mutexes are also explored in detail.
The next chapter is on the Internet related classes. Here, the utility of the Web classes and their role in building server and client applications are highlighted.
The last chapter in this section takes on a different hue. It encapsulates the crux of writing programs to implement the concept of 'remoting'. This involves the composition of a client and a server program on different machines.
The spotlight then moves on to the concept of Winforms in Section II. This chapter is replete with practical and useful insights into how Winforms can be put to optimum use in the .Net world. The C# language provides the facility of generating user-interfaces having aesthetic appeal, either by implementing the ready-to-use Form Controls, or by using controls crafted by us, in order to receive inputs from an end user.
The subsequent chapter in this section delves upon the Database Controls. This chapter has been sedulously crafted, to capture the essence of this significant activity and to reveal its intricate details.
The ubiquitous task of printing is the focus of the next chapter. The contents of this chapter will equip you to print output with practiced panache.
The last section is devoted to XML, which is the most hyped language in the current market scenario. An XML file embodies an assortment of components, which will be unraveled, one at a time, in the chapters of this section.
At the outset, the common XML classes have been highlighted, to provide an introduction to XML concepts, which are used while programming in the C# language.
The next two chapters focus on DTD, which is an acronym for Data Type Definition, and also on the XML Data Document. They provide information on the various elements employed while generating an XML file.
The topic of XML Documentation provides a hiatus from the preceding abstruse topics. It has been laced with effervescent text and examples to liven up the proceedings.
We have applied utmost perspicacity to ensure that accurate, useful and relevant explanations, laced with lucid and practical examples, be presented to expound the various concepts to both, the amateur and the proficient programmer alike.
We assure you that, by the time you disembark from this intellectual voyage of discovery, the various concepts that have been presented, are doubtlessly bound to create an indelible imprint on your minds.

C# - The Basics

By Vijay Mukhi and Sonal Mukhi
This is our second book on C# so we have assumed that you have read our first book, 'C# - The Basics'. It contains a lot more on the C# language that we could not cover in the first one.
We have read a lot on what Microsoft and others have written, and wherever we liked the idea, we simply copied it. And because we have picked from so many places, there was just no way we could mention each and every of them. If you like an idea in this volume, please do the same. The objective is to spread the C# message!
People often tend to compare C# with Java. It is with reason, and there's nothing wrong in doing so. All that we would like to say is that C# has everything of Java and more. But very soon, you could well have Java or some other language that betters C#'s act.
Today, C# is king of the hill, but we don't know how long it will last. If and when the king is dethroned, we will be there paying our respects to the new king. With a new book, of course.
We are basically teachers, and believe that a book is a simple extension of teaching. So in our books, we go step-by-step and systematically because that is the way one teaches in real-life.

Followers