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.

C# to Microsoft's IL

By Vijay Mukhi
The .NET languages are growing more pervasive by each passing day. We, therefore decided to explore the world of Intermediate Language (IL), a language to which all the source code written in various languages such as C#, COBOL etc. get compiled. IL represents the transient stage in the process of conversion of source code into machine language. It is inescapably imperative to gain mastery over IL, because knowledge of IL translates into competence over IL code that may have originally been written in any programming language. Thus, it provides a common platform to all the programming languages. Realising its importance in the scheme of things in the .NET world, we decided to get under the skin of IL and unravel its mysteries.
IL puts an end to the unending dissidence amongst programmers with regard to the superiority of one programming language over the others. To this end, IL is a great leveller. It is also a stupendous facilitator because, in the .NET world, one part of the code may have been written in COBOL, while another may have been written in C#, but it all eventually gets converted into IL. This provides great freedom and flexibility to a programmer to select the language he/she is most familiar with and does away with the need to constantly retrain oneslf to learn new languages that seem to crop up every other day.
Our modus operandi has been to strip the sheen of complexity surrounding IL by presenting complex concepts in a simple and comprehensible manner. These concepts have been corroborated with lucid examples. We have put into service all the powers of clairvoyance at our disposal to discover and illustrate concepts of IL, that are not readily discernible to the layman.
To facilitate the understanding of the sample programs, in every example, we have first presented the source code of the programs in the C# language, and then, we have offered their equivalent IL code. Thereafter, we have applied reverse engineering to fathom the IL code by unravelling the equivalent C# code. We have demonstrated how, in some cases, IL transcends the limitations of conventional programming languages; while in others, it falls awfully short of expectations. Though we don't expect undue approbation, it would not be immodest to mention that, while working with the Beta version of IL, we have unearthed many undocumented features and lacunae, which we have highlighted in the book for your benefit.
To conclude, it can be stated that the aim of this book is to explain the various nuances of IL and to make you adept at understanding IL code. It is also our desire to alleviate your fear of lower level languages. The lure of IL lies in its simplicity coupled with its tremendous power, which makes an intoxicating cocktail. But, don't be beguiled by the apparant simplicity of the examples. We don't expect an acquiescent attitude from you. Instead, we implore you to try out all the examples by yourelf and ascertain their outcome. Thus, don't stand ruminating at the brink of this exciting sea of knowledge. Dive right in! We assure you that you shall come out a winner at the end of this sojourn into the world of IL

C# Faq For C++ Programmers

By Andy McMullan
The C# FAQ for C++ programmers was first posted in Aug 2000, and is regularly updated. It answers many of the questions that C++ developers have when they first encounter C#. I recommend that you read the .NET Framework FAQ before reading this one.
What is C#?
C# is a programming language designed by Microsoft. It is loosely based on C/C++, and bears a striking similarity to Java. Microsoft describe C# as follows:
"C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced 'C sharp') is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++."
How do I develop C# apps?
The (free) .NET SDK contains the C# command-line compiler (csc.exe). Visual Studio has fully integrated support for C# development. On Linux you can use Mono.
Does C# replace C++?
There are three options open to the Windows developer from a C++ background:
  • Stick with standard C++. Don't use .NET at all.
  • Use C++ with .NET. Microsoft supply a .NET C++ compiler that produces IL rather than machine code. However to make full use of the .NET environment (e.g. garbage collection), a set of extensions are required to standard C++. In .NET 1.x this extended language is called Managed Extensions for C++. In .NET 2.0 ME C++ has been completely redesigned under the stewardship of Stan Lippman, and renamed C++/CLI.
  • Forget C++ and use C#.

Each of these options has merits, depending on the developer and the application. For my own part, I intend to use C# where possible, falling back to C++ only where necessary. ME C++ (soon to be C++/CLI) is very useful for interop between new .NET code and old C++ code - simply write a managed wrapper class using ME C++, then use the managed class from C#. From experience, this works well.

Click to Read More

C# .NET Web Developer’s Guide

By Adrian Turtsch, DotThatCom.com, Jason Werry, Greg Hack and Joseph Albahari
For many years, C and C++ programmers have been searching for alternative programming languages that offer the same kind of flexibility and power of C and C++, but without the complexities and steep learning curve required for mastery of the language.What many programmers desired was a language that would allow applications to be built rapidly, but at the same time giving them the ability to code at low level.The search has finally ended with Microsoft’s new language—C#, a member of the .NET Framework.
C# is the revolutionary new language from Microsoft, designed solely to run on the .NET framework. Drawing experiences from C, C++, and Visual Basic, C# was designed to be a simple and modern object oriented programming language.
But why learn C#? With the integration of C# and the Visual Studio.NET (known as Visual C#), developing Windows and Web applications has been radically simplified.With full access to the .NET Class Libraries, C# includes built-in support for developing robust Web services and ASP.NET applications. (It was reportedly said that Visual Studio.NET was built entirely using C# and that most of the examples in MSDN were coded in C#.That in and of itself is a very good reason to learn C#!) Besides this, C# enhances the productivity of programmers by eliminating common errors often associated with C and C++.
While many of the earlier C# books have primarily focused on the language syntax, The C# .NET Web Developer’s Guide illustrates the uses of C# for Web developers looking to harness the new functionality and ease of this powerful programming language.The best way to learn a new language is by trying out the examples while you are reading this book.Within many chapters, you will find numerous code examples used in various practical situations; this hands-on, code-intensive approach allows you to have a deeper understanding of issues involved in C# Web development, and at the same time allows you to cut and paste portions of applicable code into your current projects, thereby shortening development time.
We are constantly working hard to produce the best technical books needed by professional programmers like you. I sincerely hope you will enjoy reading this book as much as the authors did writing it!

C# Language Reference

By Anders Hejlsberg and Scott Wiltamuth
C# is a simple, modern, object oriented, and type-safe programming language derived from C and C++. C# (pronounced “C sharp”) is firmly planted in the C and C++ family tree of languages, and will immediately be familiar to C and C++ programmers. C# aims to combine the high productivity of Visual Basic and the raw power of C++.
C# is provided as part of Microsoft Visual Studio 7.0. In addition to C#, Visual Studio supports Visual Basic, Visual C++, and the scripting languages VBScript and JScript. All of these languages provide access to the Microsoft .NET platform, which includes a common execution engine and a rich class library. The Microsoft .NET platform defines a "Common Language Subset" (CLS), a sort of lingua franca that ensures seamless interoperability between CLS-compliant languages and class libraries. For C# developers, this means that even though C# is a new language, it has complete access to the same rich class libraries that are used by seasoned tools such as Visual Basic and Visual C++. C# itself does not include a class library.
The rest of this chapter describes the essential features of the language. While later chapters describe rules and exceptions in a detail-oriented and sometimes mathematical manner, this chapter strives for clarity and brevity at the expense of completeness. The intent is to provide the reader with an introduction to the language that will facilitate the writing of early programs and the reading of later chapters.
Click to Download

Visual Studio.NET with C#

By Vijay Mukhi, Suraj Godhwani, Sonal Mukhi
This book on Visual Studio.Net is a trailblazer, since it is extremely innovative in its approach. It is a screen-based book, which suggests that the entire book is packed with screens, making it very easy and intuitive for a reader to grasp the explanations accompanying them. It makes for an interesting reading, and also does away with the requirement of sitting in front of a computer while reading this book.
Visual Studio.Net facilitates a paradigm shift in the programming world. It has alleviated the task of software development considerably, by synthesizing all applications into a single product. Earlier, every product had its own User Interface, and programmers had very strong loyalties towards specific products. This prevented their smooth migration from existing products to the newer products, which emerged with systematic regularity.
In the Visual Studio.Net environment, building complex applications is a breeze. The switch over from one runtime to another, is also considerably smooth and effortless.
During our perambulation through the various facets of this fascinating product, we have adopted a 'step-by-step' approach to unravel the various features. We have pared down the irrelevant details, and converged only on the most pertinent areas. We have systematically built-up on own our earlier explanations incrementally. For instance, after ensuring that the reader is comfortable with building various types of applications, we have graduated onto the topic of deployment, so that the reader can then, transport his application with ease.
Readers are well advised to peruse the text thoroughly, enter the code as demonstrated, and run the applications, to get a hands-on experience of the product. This is the best available approach to master this product.
For those with an insatiable appetite for technical knowledge, we have exhumed the surface, in order to disinter and explore the workings of the C# language. The latter chapters expound the C# code, generated by the framework for applications built in the earlier chapters.
The three-pronged novel approach of firstly, adding visual appeal by incorporating a plenitude of screens, secondly, of providing simple and complex applications to illustrate various concepts, and finally, of going behind the scenes to explore the c++ code generated by the application, is the linchpin of this book.
We have persevered to simplify the preplanning concepts and have percolated the grain from the chaff. The perspicacity of the text is an important feature implemented by us.
This book contains a plethora of information about Visual Studio.Net and the C# language. We have focussed our attention on Visual Studio.Net, since it is going to play an increasingly important role in the field of computer programming, and its ramifications are going to be far-reaching. So, you would be well-advised to climb onto this bandwagon and scale the heights with us, without much ado.

Programmer's Heaven C# School Book

By Faraz Rasheed

The Programmer's Heaven C# School book covers the .NET framework and the C# language. Starting with the basics of the language, it goes on to cover object oriented programming techniques and a wide range of C# languages features including interfaces, exceptions and delegates. Later chapters cover practical topics including database access with ADO.NET, building Windows forms applications, multi-threading and asynchronous I/O. The final chapter covers new features in C# 2.0, including generics.
The book is divided into three progressive levels. In the first beginner stage we will be discussing the .Net Framework, C# Language Fundaments and Object Oriented Programming.
In the second intermediate section we will go into depth with Object Oriented constructs such as inheritance, polymorphism, abstract classes, interfaces, structures, enumerations and exceptions.
In the third and final advanced section we will delve into what is required to implement real world applications using C# with Base Libraries, focusing on topics such as Collections, Delegates, Events and Windows Programming with a number of controls, as well as Data Access with ADO.Net, Threads and Streams.

C# Tutorial Contents

C# Tutorial Lesson 1: Introducing the Microsoft .NET Framework
NET (dot-net) is the name Microsoft gives to its general vision of the future of computing, the view being of a world in which many applications run in a distributed manner across the Internet. We can identify a number of different motivations driving this vision.
Firstly, distributed computing is rather like object oriented programming, in that it encourages specialised code to be collected in one place, rather than copied redundantly in lots of places. There are thus potential efficiency gains to be made in moving to the distributed model.
Secondly, by collecting specialised code in one place and opening up a generally accessible interface to it, different types of machines (phones, handhelds, desktops, etc.) can all be supported with the same code. Hence Microsoft's 'run-anywhere' aspiration.
Thirdly, by controlling real-time access to some of the distributed nodes (especially those concerning authentication), companies like Microsoft can control more easily the running of its applications. It moves applications further into the area of 'services provided' rather than 'objects owned'.
Interestingly, in taking on the .NET vision, Microsoft seems to have given up some of its proprietary tendencies (whereby all the technology it touched was warped towards its Windows operating system). Because it sees its future as providing software services in distributed applications, the .NET framework has been written so that applications on other platforms will be able to access these services. For example, .NET has been built upon open standard technologies like XML and SOAP.
At the development end of the .NET vision is the .NET Framework. This contains the Common Language Runtime, the .NET Framework Classes, and higher-level features like ASP.NET (the next generation of Active Server Pages technologies) and WinForms (for developing desktop applications).
The Common Language Runtime (CLR) manages the execution of code compiled for the .NET platform. The CLR has two interesting features. Firstly, its specification has been opened up so that it can be ported to non-Windows platforms. Secondly, any number of different languages can be used to manipulate the .NET framework classes, and the CLR will support them. This has led one commentator to claim that under .NET the language one uses is a 'lifestyle choice'..............
C# versus Java
C# and Java are both new-generation languages descended from a line including C and C++. Each includes advanced features, like garbage collection, which remove some of the low level maintenance tasks from the programmer. In a lot of areas they are syntactically similar.
Both C# and Java compile initially to an intermediate language: C# to Microsoft Intermediate Language (MSIL), and Java to Java bytecode. In each case the intermediate language can be run - by interpretation or just-in-time compilation - on an appropriate 'virtual machine'. In C#, however, more support is given for the further compilation of the intermediate language code into native code...........

C# in Detail

By Jon Jagger
C# in Detail is also available as an instructor led course
  • an interactive, friendly, expert instructor
  • Jon has worked for Microsoft using C#
  • lots of great exercises
  • to make sure you understand
  • even more slides
  • with detail, explanations, and rationales
  • full slide notes
  • include careful comparisons with C++ and Java

C# Features

  • C#, C++ and Java - static typing, runtime polymorphism, exceptions, reference types
  • C# and C++ - compile time polymorphism ?,value types, operator overloading,
  • C# - unified type system
  • C# and Java - multiple public realization, non deterministic finalization, multi threading, garbage collection, single public inheritance, Object super base class, virtual execution system, reflection

Summary of Part 2

  • arrays: rectangular, ragged, params
  • string: immutable, readonly[], verbatim
  • class: ref/out, static c'tor, boxing
  • exceptions: lock, no throw-specs
  • GC: d'tor, using statement, IDisposable
  • inheritance: positional, virtual/override
  • interfaces: no fields, EII, properties, indexers
  • nested types: Java access, C++ semantics
  • delegates: function pointers, single and multicast
  • events: restricted multicast delegate
  • assemblies: logical DLL, no registry, versioning
  • namespaces: shorthand syntax
  • reflection: metadata, introspection, intercession
  • attributes: add to metadata, reflect

Click to Download

C# Classes - Threads, Winforms and XML

By 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# :Your Visual Blue Print for Building .Net Applications

By Eric Butow and Tommy Ryan
C#: Your Visual blueprint for building .NET applications uses simple,straightforward examples to teach you how to create powerful and dynamic programs.To get the most out of this book, you should read each chapter in order,from begining to end. Each chapter introduces new ideas and builds on the knowledge learned in previous chapters. Once you become familiar with C#: Your visual blueprint for building .NET applicaitons,this book can be used as an informative desktop reference.
Who this Book is For
If you are interested in writing programs for the new Microsoft C# programming language, then C#: Your visual blueprint for building .NET applicaitons is the book for you.
This book will take you through the basics of using the Visual Studio Microsoft Development Environment (MDE) window and familiarize you with the essentials of C# programming. The book even covers advanced topics including creating forms, macros,and web applications.
No prior experience with programming is required, but familiarity with the Microsoft Windows operating system installed on your computer is an asset.

ASP.Net With C# - The Basics

By Vijay Mukhi, Sonal Mukhi and Neha Kotecha
ASP.Net provides the most powerful environment for development of sophisticated, real-life business applications. It was only natural for us to get sucked into the vortex of the exciting opportunity that this language provides, to satiate our technical appetite. This book presents a realistic tableau of the vast repertoire of features of the ASP.Net language. We have scythed through the maze of technological jargon to present to you, in a simple yet comprehensive manner, all the salient features of the language.
The book commences with the assumption that you are a programming tyro, with no previous knowledge of ASP.Net or C#. It however, expects you to have a working knowledge of the Hyper Text Markup Language (HTML). The book covers the length and breadth of the ASP.Net framework. Since the C# language has been used for programming, the fundamentals of this language have also been covered.
The book begins with the basics of the ASP.Net and C#. Thereafter, it moves on to the built-in controls of ASP.Net. Next, it demonstrates how you can build your own custom controls. The text then veers on to the concepts of the built-in C# classes, and shows you how to build your own custom classes. It also covers the myriad aspects of handling databases, advanced concepts of controls, mysteries of Cookies, CGI Progamming and state management,Web Services and finally a Class Browser Application. It finally winds up with a peek into the security issues of designing an Internet application using ASP.Net. Thus, you’ll be able to appreciate, that a vast array of technical concepts of ASP.Net have been covered by this book.
This book is teeming with examples and explanations that discuss each concept threadbare. The various disparate concepts have been woven together to create a beautiful tapestry of the ASP.Net language. It has always been our modus operandi to break up large programs into smaller fragments, comprehend each fragment thoroughly and subsequently, synthesize all the fragments together to retrieve the original program. The same strategy has been employed in this book also. Each concept has been substantiated with examples so that you can see how each concept is implemented in real-life applications.
In our books, we have presented examples that emulate a concept supplied in the documentation, or some idea we found on the Internet. However, some of the concepts introduced are purely ours, and thus original. As far as we are concerned, you are free to use our accepted wisdom, as long as someone somewhere in the world benefits from it.
We are sanguine that this book will go a long way in providing ample food for thought, to sate the technological hunger of your minds. We implore you to put in sedulous effort in mastering this language, by reading all the material provided to you in this book with sincerity, and also by trying out all the examples that have been presented. We are confident that on doing so, you will be able to scale dizzying heights in the world of Internet programming.

A Comparison of Microsoft's C# programming language to Sun Microsystem's Java Programming Language

By Dare Obasanjo
The C# language is an object-oriented language that is aimed at enabling programmers to quickly build a wide range of applications for the Microsoft .NET platform. The goal of C# and the .NET platform is to shorten development time by freeing the developer from worrying about several low level plumbing issues such as memory management, type safety issues, building low level libraries, array boundschecking , etc. thus allowing developers to actually spend their time and energy working on their application and business logic instead. As a Java developer the previous sentence could be described as "a short description of the Java language and platform" if the words C# and the .NET platform were replaced with words Java and the Java platform.
What follows is an overview of similarities and differences between the language features and libraries of the C# and Java programming languages based on my experience using both languages. All code snippets below were tested on Microsoft's .NET Framework Beta 2 for C# snippets and Java™ 2, Standard Edition (J2SE™) version 1.4 Beta 2 for the Java snippets.

Followers