C# Corner

Resources  
  • Mobile with Access DatabaseJul 14, 2001. Till now we had done the Programming using SQL Server and XML as Database.
  • Post in Mobile FormsJul 27, 2001. Till now whatever we are doing is in single page and the traversing between forms take place only in a single Page. If you Remember Something of WML there our most effective funda is posting from one form to other.
  • Multiple Inheritance in C#Aug 29, 2001. Can you inherit from multiple classes in C#? Simply put, this cannot be done. However there are ways around it. From a design perspective you must ask yourself, will a Class fully represent an object?
  • Uploading and Downloading Web FilesOct 05, 2001. This program is for beginner, shows how to use web client class to Download and upload file from the Internet and how to save them to disk. Download or upload file can be done using Method DownLoad Or UpLoad.
  • C# and ActiveX DLLDec 14, 2001. As you know with Visual Basic 6.0, it is possible develop a COM server and implement them in a Visual Basic client program. But this is being done by using Visual Basic. You may wonder about the idea of calling this DLL in a C# Application. Well, C# language provides us a way to call this COM server in a program. When we compile a C# program an Intermediate Language is generated and it is called as Managed Code.
  • Calling Managed Code from Unmanaged CodeMar 11, 2002. One significant part of developers (including myself) are doing some kind of automation of Microsoft Office. So I will concentrate on opposing side of problem, how to use managed assembly from MS Office or VB script. In this article, I will discuss how to call managed code from unmanaged code.
  • Macro to Add Strong Names to VS.NET ProjectsAug 06, 2002. When writing class libraries in Visual Studio .NET that are going to be placed into the GAC you will need to add strong name to the assembly. This is normally done by dropping out to a dos prompt and running the .NET utility sn.exe and then updating the assembly to reference the newly created .snk file.
  • Events in C# Advanced - Lesson2Jan 02, 2003. In the previous lesson we created an event and consumed it. In doing so you probably noticed that our code would have been a little better if we could have determined whether or not the file actually existed.
  • Developing Secure Web Sites with ASP.NET and IIS - Part IMar 04, 2003. Developing security for a site is like paying tax. You know it should be done at the end of financial year.
  • Developing Secure Web Sites with ASP.NET and IIS: Part IMar 04, 2003. Developing security for a site is like paying tax. You know it should be done at the end of financial year. But you keep it for the last and some time expect you should never have to do it. It is a similar kind of situation when building a web site. There are some web sites available to general public that can be access by any one. The security for these sites can be minimum or none at all. There are some web sites that publish and hold important information that have to be secure one way or another.
  • Execution-Time Code Generator for C#Mar 06, 2003. The Common Language Runtime provides a new way of doing things. The compile-time world still exist, but it is also possible to build dynamic systems where new code is added by loading assemblies or even by writing custom code on the fly.
  • Opening and Viewing Text and Image FilesMar 08, 2003. We will start this article with a simple application where we will learn how to open and view text and image files using the OpenFileDialog class. In doing so, we will learn some basics of GDI+ drawing, menus and panel control.
  • Interlocking ThreadsSep 10, 2003. Recently, I was building multi-threaded applications and noticed some intermittent data inconsistency. Soon, I found the culprit was locking mechanism. After doing some research, I gathered the following information and as usual decide to share with you guys.
  • Late Binding With ReflectionOct 20, 2003. Component based technology has done great things for software development, allowing reuse and leading to better-written code that separates subjects and entities into distinct components.
  • State Management in Web FormsFeb 18, 2004. This white paper discusses the ways in which the state management can be handled in web forms. State management can be done either on client side or server side as explained below.
  • Generating Microsoft Excel Reports in .NETMar 01, 2004. Microsoft Excel is installed on most computers these days since it is part of Microsoft office, and you can create detailed reports with Excel, but it will take some doing. I will attempt to show you how to create a simple report in Excel and some of the problems you may encounter along the way, this will work with Excel 97-2000.
  • Navigating Data Grid using Client ScriptingNov 10, 2005. It's very common practice to use the Data Grid to present data over web pages. Though the Data Grid is provides the richer UI presentation if not coded and handled effectively it can have great performance issues. This article gives the code sample for navigating the data grid using the Client Scripting (thereby can be used for lots of validation before doing the Post Back to the server) and minimizing the round trip to server
  • How Easy Cryptography is in VS.NetMar 08, 2006. What can be done regarding the security issues? Part of the solution is to secure important data - more specifically, using strong encryption thats what we will see in this article.
  • Book Store Application using ASP.NET 2.0Oct 13, 2006. This project is done using ASP.NET 2.0 and SQL Server 2005. This application covers all the basic aspects a developer needs.
  • Word automation using C#May 11, 2007. Word Automation through C# is all about programmatically generating the Word Document using C# code. Almost all of the tasks which we perform on word 2003 can be done programmatically using C# or VB.
  • Multi-threaded Asynchronous Programming in C#... Getting started.May 12, 2007. Trying to build better solutions and growing as a developer has always been fun for me and I’m always looking for ways to build more scalability and robustness in the software I am writing. I had a revelation that I’ve been doing a lot of C# tweaking but not taking advantage of the core performance enhancements cooked right into C# and it all comes down to one thing: Asynchronous multi-threaded programming.
  • High Performance Abstraction Layer for Non-Blocking Asynchronous Thread Safe SqlServer CallsApr 25, 2008. One of the things I find myself doing frequently is writing (and re-writing) plumbing code to execute database CRUD operations. I wrote an abstraction layer over asynchronous SqlServer calls that allows developers to correctly make async calls agains SqlServer without having to deal with any of the complex plumbing normally required. All source code is included with this article.
  • State Management is Silverlight using Isolated StorageJul 28, 2008. State management is the process to maintain state and page information over multiple requests for the same or different pages. State management in Silverlight 2 can be done using the concept of Isolated storage.
  • Bulk DML With SQL Server 2005 - XML Data TypeOct 15, 2008. This article explains about doing bulk DML on SQL Server 2005 using XML datatype
  • Using function point to quote a softwareApr 06, 2009. If you give more quote you lose the project, if you give less quote you will end up doing social service to clients and probably also loss. In this tutorial, we will discuss mainly "Function Point" from practical point of view.
  • Cell Merging In GridViewMay 19, 2009. In many asp.net applications, we use the GridView control for displaying data. It is a very helpful control and powerful indeed. Many operations can be done using the grid view control but the UI presentation is more important as it is the look-n-feel that matters a lot. In this small article, I will demonstrate how the cells of the grid can be merged as I have been asked to do the same in one of my recent projects.
  • How to improve your LINQ query performance by 5 X times ?Jul 17, 2009. LINQ has been criticized by many early adopters for its performance issues. Well if you are just going to drag and drop using DBML code generator I am sure you will land up in to mess. Try doing this make a simple LINQ to SQL project using DBML and see your SQL profiler, I am sure you will never like to touch DBML code generator again. In this article we will first look in to how LINQ queries are executed, and then we will touch base on how compiled LINQ queries can help us improve our application performance at least 5 times. My numbers can be 10% up and down as I had come to that figure using my environmental situations.
  • The C# Asynchronous Programming ModelJul 27, 2009. This article will start by examining how to use the Asynchronous Programming Model (APM) to perform an asynchronous compute-bound operation, then describe the three styles of programming with the APM to deal with handling the end of the call in an asynchronous call: wait-until done, polling, and callback. The natural following is then the Thread Pool.
  • Calling COBOL from C#Jul 28, 2009. There is a lot of COBOL code in production around the world. Rewriting that code into another langugage just to change the language makes little sense and introduces a high level of risk. Instead of changing the COBOL code that has been working and doing it's job for quite a while, why not interact with it using C#? This article shows how to utilize C# to call both procedural and object oriented COBOL.
  • Developing a New Control Using VSM in Silverlight 3Jul 31, 2009. Silverlight provides a Visual State Manager (or VSM) that manages different states as users interact with controls. For example, you might want to change the background of the Button as the user mouses over it and make it look slightly bigger or smaller when a user clicks it. All of this can be done using the Visual State Manager. The discussion that follows will walk through show how custom templates and VSM states can be created visually.
  • Creating Forms with COBOLNov 05, 2009. We've done numerous articles on how to interface COBOL with other .NET languages. Here is something a little different, creating a form using only COBOL. This is part 1 or the article and it will cover creating the form, adding controls and enabling them and calling .NET classes. Part 2 will show you how to make things disappear!
  • Control Statements in C#Nov 20, 2009. In this article I will explain you about different control statements in c#.
  • Using PLINQ to Improve Learning AlgorithmsNov 30, 2009. PLINQ is a welcome addition to the .NET 4.0 framework, allowing us to operate on collection elements in parallel. This article examines the performance improvements of PLINQ over LINQ when doing heavy calculations on a large collection of genomes in a particular learning algorithm.
  • Simple 5 steps to run your first Azure programJan 07, 2010. In this article we will look in to 5 basic steps which will help us to run our first azure program. In this article we will understand how to create a simple web role application and while doing the same we will understand some development concepts of Azure.
  • Single instance of application in C#Mar 25, 2010. There is some application that we want that only single instance of application works at a time. So here in this article is the logic for doing that.
  • Scene Management in XNAMay 05, 2010. In this tutorial I will make it as simple as it can be. To teach you how very easily "Scene Management" can be done.
  • Silverlight 4.0 XAML FeaturesMay 10, 2010. With Silverlight 4.0 there are some changes done in XAML parser. In this article I am going to cover some of the main changes done in XAML parser.
  • Creating Anonymous Site using SharePoint Existing Web ApplicationJun 21, 2010. From long time I was looking after this as curiosity, and now after some google I have understood how this can be done, I will be summarizing points and procedure which is used to create anonymous site by using existing SharePoint web application.
  • Interviewing "Must DOs and Please DON'Ts"Sep 06, 2010. In this article I have pulled together a handy list of the "Must Do's" and the "Please Don't" to help you land the position you are going after.
  • 3 Ways of Doing Optimistic Locking in .NETSep 18, 2010. In this article we will touch base 3 ways of doing optimistic locking i.e. Using ADO.NET dataset, SQL Server Timestamp check and old / new value check.
  • MSChart - Drilldown Charts: Part IISep 20, 2010. This is simple and easy way of doing is by assigning PostBackValue for Chart Points. We can assign any value as PostBackValue. On Chart Click event handler, we can retrieve this PostBackValue.
  • MSChart - Drilldown Charts: Part IIISep 21, 2010. This part of article will helps in doing drilldown on single Chart only. There is no change in logic, only rearrangement of code lines and also a button introduced to plot master chart again back from .xml file after drilldown.
  • Session Variables as ObjectsSep 22, 2010. Everyone uses session variables at some point in their career. What I am doing is offering what I feel is a better way to deal with session variables.
  • Grouping ListView items dynamicallySep 24, 2010. This article demonstrates one of the ways that dynamic ListView grouping can be done.
  • 6 Ways of Doing Locking in .NET (Pessimistic and Optimistic)Sep 28, 2010. This article talks about 6 ways of doing locking in .NET. It starts with concurrency problems and then discusses about 3 ways of doing optimistic locking.
  • Contributor settings in SharePoint Designer 2007Nov 02, 2010. In this article I am showing how we can make SharePoint site protected in SharePoint designer for unexpected changes. I am doing a demo on how to setup permission levels in SharePoint Designer.
  • ReSharper - The Magic Bullet For Visual StudioNov 03, 2010. If you are doing coding on a daily basis then ReSharper for Visual Studio is a life changing product. With ReSharper you will see a change in productivity and maintainability in your programming practices. Read on to see how ReSharper can help you.
  • I Want to be a Consultant in .NETDec 07, 2010. You have been doing .NET technology as an employee and now you are considering breaking out into your own business as a consultant. Here are the things to consider and how to go about getting .NET consulting off the ground.
  • WPF Page Based NavigationDec 27, 2010. In a WPF application, you can navigate from one page to another page; such a navigation system is known as Page Based Navigation. Page based applications are developed using the Page class and can be done through the XAML and code behind file.
  • Navigation in Silverlight Without Using Navigation Framework Jan 07, 2011. Silverlight 3 introduces Navigation Framework which takes care of this, but let's first try to achieve navigation and state management without this framework; or you can say, the way it is done in Silverlight 2.
  • Find nth element from last in a Linked ListJan 27, 2011. One very interesting problem is to find the nth element from the end in a linked list. Now it's very easy to find the nth element from the beginning of the list and can be done in one traverse. So what are the various solutions we can think of.
  • Doing Arrays - C#Feb 24, 2011. The article explains type of arrays in C# with easy to understand examples.
  • Simplest example of MVP design pattern of Asp.netMar 10, 2011. So here we’ll discuss the MVP pattern. MVP is Model, View , Presenter. This pattern is how the interaction between these layers can be done.
  • Service Application Framework improvement in SharePoint 2010Mar 18, 2011. In SharePoint 2010 a variety of improvement have been done in Service application frame work. I provide you an introduction to Service Application Framework in SharePoint 2010.
  • Windows Phone 7 DatePicker ControlMar 28, 2011. This article demonstrates the use of a DatePicker control in Windows Phone 7. By default the DatePicker shows today's date; when the control is clicked a dialog should open for selecting day, month and year; then after clicking done, the selected date should load into the control.
  • COCOMO 1/ COCOMO'81: Constructive Cost Estimation ModelMar 31, 2011. It is a method for evaluating the cost of a software package. According to him software cost estimation should be done through three stages.
  • Configuration Settings for an ASP.Net ApplicationApr 04, 2011. In ASP.Net, all that needs to be done to configure an application is to create a Configuration file called ‘Web.config’ and place it in the root directory of the application.
  • XML based Search Engine in ASP.NET 2.0Apr 18, 2011. This article basically deals with the idea that, in the manner that we search in google.com, the same thing can be done for an xml file.
  • Maintaining Scrollbars in Document Editing ApplicationsMay 15, 2011. When coding a document editing application, maintaining scrollbars is a task that must be done correctly to have an accurate and responsive document viewer. This article gives precise instructions how to calculate values of different scrollbar attributes so that scrolling functionality is coded correctly.
  • ASP.Net MVC3 RoutingMay 18, 2011. In this article I will describe what is routing in MVC3 and how it can be done.
  • Handling DropDownList With Ajax in ASP.NETJun 09, 2011. In this article I will describe after binding data or values from an XML file to a DropDownList when we will select a particular item in the DropDownList it will display the selected item without any post back to the server. That means that an Asynchronous post back will be done.
  • Insert Into and Remove From a ListBox Selected DropDownList Values In ASP.Net with AjaxJun 10, 2011. In this article I will describe how to add items into a list box from a particular DropDownList. And after that how to remove the selected items from the list box and remove all items. All this is done without any post back events; that means asynchronously.
  • Using Auto Intelligence Using C# Code Snippet for Faster Coding in C#.Net Jun 16, 2011. It is a developer's tendency to achieve functionality and forget the basic structure required in the project. Later we need to add region, try blocks and copyright information to make it professional. I myself have done many of these reworks, so my current project inspired me to think of different directions to implement an Auto Intelligence to avoid such situations.
  • DataGridView to Word And ExcelAug 04, 2011. This is a sample way of doing it. In this you can find how we can export a DataGridView to Word and Excel documents.
  • SystemTray and Progressbar in Window Phone 7 Twitter Search ApplicationAug 20, 2011. In this post we’ll create an Window phone that will utilize the System Tray progress bar for waiting while the work is being done in background.
  • WPF BusyIndicatorSep 02, 2011. A BusyIndicator control provides an alternative to a Windows wait cursor to show user an indication that an application is busy doing some processing. It is a combination of the wait cursor and the ProgressBar control.
  • Performing Data Conversion with Value Converter Class in SilverlightSep 03, 2011. The Value Converter Class in Silverlight is responsible for converting source data just before it is displayed in the target and also doing job of converting the new target value just before it is supplied back to the source.
  • SQL Azure - What's new in SQL Azure Q2 2011 Service Update - Part ISep 12, 2011. In this article we are going to see the list of enhancements done with the SQL Azure Q2 2011 Database Service Update officially announced on 9th September 2011.
  • Page.PreviousPage Method in Asp.netSep 15, 2011. In this article you will learn how to transfer data from one page to another page in ASP.NET and for doing this activity there are various ways through which we can transfer data from one page to another page
  • Upload Image from Silverlight to Azure BLOB using WCFSep 17, 2011. Working with Azure BLOB is very common task you must be doing. Sometime you may come to a requirement to upload an image from a Silverlight client to Azure BLOB. In this post I am trying to help you in achieving this.
  • Windows Azure - Create Blob in Storage EmulatorOct 21, 2011. In this article we are trying to create a blob in the storage emulator. The same blob creation can be done on storage account too.
  • Implementing the Chaocipher in C#Nov 16, 2011. Whilst doing some research on cryptography, I came across the Chaocipher.
  • Panel Slide Show using jQueryNov 19, 2011. In this article we are going to discuss how to create a slide show with a panel which will show you panel one by it is done by using jQuery.
  • Working with buttons in Micro Focus Visual COBOL Dec 01, 2011. Micro Focus released Visual COBOL R4 earlier this year and it has turned out to be an awesome addition to Visual Studio 2010. The development teams have done a great job in delivering a very usable product.
  • Writing Table into XML and dynamically adding items to Listbox in Expression BlendDec 21, 2011. In this article you will learn how to add the data to database (SQL server2008) and then write the database into the XML file and then binding data from this XML file into the listbox dynamically i.e. at the runtime. Here I have done this through a simple application in which the Employee record is fed by the user and this record is automatically added to the listbox.
  • Setting up Cruise Control Ccnet Autobuild For Every ChekinFeb 06, 2012. You need tools that will automatically keep your code clean and without an erroneous file by performing an autobulid process when a new checkin to the repository is done. I recommend the CruiseControl .Net tool for this. It's free and open source.
  • SQL InjectionMar 27, 2012. This article provides guidance for the prevention of SQL Injection in your web application and explains how SQL Injection is done.
  • How to Run DOS Prompt in Windows 8Mar 31, 2012. In this article we explain use of a DOS Prompt in the Windows 8 Operating System and runnig a Turbo C++ application in a DOS Prompt.
  • Creating a more secure 'keyless' cipher using C# Apr 11, 2012. In this article, I’d like to review two of the commonest keyless ciphers and discuss what can be done to make them sufficiently secure so we could use them in our programs.
  • Runtime Binding in Windows Store AppMay 20, 2012. Today we will discus how we can use data binding in a Windows Store Application at runtime. There is not a way to directly bind data in the front end at runtime; it can be done with the help of the Binding class and the SetBinding property of the Textbox control.
  • SharePoint 20010 - Copy List Items Across SitesJun 14, 2012. In this article I would like to demonstrate one way of Copying list from one site to another. Obviously there are many ways of doing it and I would like to use the way in which we do not need any other tools.
  • Spring Tutorial: Chapter 4Aug 09, 2012. Another really useful feature from the Java Spring framework for performing some initialization tasks in your class before the instance of it is ready to be consumed or used by anyone and also cleanup the resources of that class when done using it.
  • Joining Multiple Data-Sources Using "Concat" Key in LINQ: Part 7Sep 04, 2012. In this article we will take a look at doing joins using Concat key in a LINQ query.
  • Pagination in SQL Server 2012Oct 03, 2012. In this article, we will compare the pagination mechanism between previous versions and how the same can be done in SQL Server 2012.
  • Object Relational Mapping (ORM) Using NHibernate - Part 3 of 8Oct 08, 2012. Firstly in part 1 of this article series, it had been shown that in ORM, while mapping a one to one association between objects to their corresponding tables, the primarykey of one table is posted as a foreign key of the other table. But in ORM, mapping a one to many association is done differently
  • Turnoff User Account Control Done by Admin Only in Windows 8Oct 09, 2012. In this article I have described how to turn off User Account Control for Administrators only in Windows 8.
  • Do-while Loop in TypescriptOct 17, 2012. In this article I have described how to use a for loop in TypeScript with an example.
  • JavaScript StatementsOct 19, 2012. Today, we are going to see the use of JavaScript Statements that are very important for starting with the fundamentals of JavaScript.
  • Enabling Windows Store in Windows 8Oct 29, 2012. Some Windows 8 Distributions disables Windows Store by default,so this article covers what needs to be done to enable it.
  • Related data from one dropdownlist to another in VB.NETNov 09, 2012. Generally while doing registration in a website. When we choose any city dropdown list, its related states, country and zip code bind in respective dropdownlist.and textboxes.
  • Redirect Web Visitors by Country in VB.NETNov 09, 2012. There are times when it is useful to redirect a visitor to different default web page based on the visitor's country of origin. One practical usage is to redirect visitor to web page with the language recognized by the visitor. This article shows you how by using .NET component, it can be done.
  • Control statements in VB.NETNov 10, 2012. In this article, you will learn various control statements (looping) controls in VB.NET including Do..While, For, and foreach statements.
  • Determine Web Visitors Country of Origin in the Drop Down List using VB.NET or C#Nov 10, 2012. During the transaction online, there are times when it is important to preset the web visitor's country of origin, ZIP code, ISP and domain name at the drop down list to prevent fraud and to ease the complexity of registration task. This article shows you how by using .NET Framework, it can be done.
  • Opening and Viewing Images and Text Files in VB.NETNov 10, 2012. We will start this article with a simple application where we will learn how to open and view text and image files using the OpenFileDialog class. In doing so, we will learn some basics of GDI+ drawing, menus and panel control.
  • Create a List in C# Based on Another List in SharepointDec 10, 2012. We can copy a List from one SharePoint site to another using List Template Exporting & PowerShell. In this article we will see the Server Object Model way of doing that.
  • Deleting Duplicate Records From a Table in MS SQLDec 26, 2012. Deletion of duplicate records from a table is tricky and can be done in various ways. One simple approach can be applied as described in this article using a Group By and sub-query.
  • Interface in C#: Part 1Jan 07, 2013. In this article we will look at the common things that need to be done to declare and implement an interface.
  • Thread Pool in Windows Store ApplicationFeb 01, 2013. This article shows another way of doing asynchronous programming in a Windows Store application using a "Thread Pool".
  • Import Gmail Contacts in ASP.NETFeb 22, 2013. I tried here to describe “Import Gmail contacts in ASP.Net”.Hope I ll explain it here in a better way so that everyone facing this issue can done this like the way I done.
  • Saving Data Using DataGridview and Doing CalculationsMar 18, 2013. This article will help for saving data (Items via DataGridView) in the database in Window Forms using C# and SQL Server.

About do-while

NA
File APIs for .NET
Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!
Download Free eBooks