Sub-Queries, Derived Tables, and Common Table Expression Examples

Common Table Expression (CTE) Example

In this example, we will explore some useful select queries that comes handy when we want to retrieve data from different tables. There many ways one can form select queries that returns the same result. For this article, we will use Microsoft’s Pubs database and explore Sub-Queries, Derived Tables and Common Table Expressions (CTE). We will explore these queries one by one.

RDLC Report & ReportViewer Control in C#

Designing the RDLC Reports - Page Header & Footer, Report Header, Footer & Details

In this RDLC Reports tutorial, we will explore how to generate the RDLC Reports using the Microsoft supplied report template (.RDLC file). We get the data from the ‘Titles’ table of the Microsoft supplied ‘Pubs’ database. In this example, the ReportViewer Control acts as a presentation UI.  To generate the report on the database table, we will use following things: ‘DataSource’ that supplies the data from the database. ‘Report Template’ that defines the visible elements and its location. [.RDLC file] ‘ReportViewer Control’ supplied by the dot net framework. ‘C-Sharp Form’ that houses the ReportViewer control in it.

ObjectDataSource & GridView Control Explained

Asp.Net and ObjectDataSource via Business Layer

In this Example, we will see the usage of the ObjectDataSource Control. We will create a web page with a GridView Control and link that control to the ObjectDataSource control. The user will perform data handling through the GridView control. The GridView intern uses the ObjectDataSource to delete or change a record.

Publish Application With One-Click Install

Publishing C# Application to a Shared Location

Publishing the application in a shared location is useful and pays off for both publisher and clients subscribed to the published application. In the publisher point of view, they no need to cut CDs and ship to every client. Also from the end user point of view, they will get the update to the application that they are using. This example will explore, Publishing the application in Network shared path Providing the Update notification to the Client Pushing the updates forcibly to the Installed client location

C# WebBrowser Control Explained

C# WebBrowser Control Example

The ‘C# WebBrowser Control’ provides the capability of browsing the web pages to our application. One can also display their own HTML content through the web browser control. That means he/she can generate all fancy reports in html content and then display that in a WebBrowser Control. In this example, we will explore how to design simple browsing window. Note, even though this example acts as a browser, when you are browsing using this sample, do not provide any sensitive information. This is just a sample that shows the use of WebBrowser Control. At the end, we will also explore how to display the user content with button click and hook that to the C# handler method.

Dynamically Changing ASP.Net Web Config File

The Dynamic ASP.Net Web Config Update Example

The Web.config file supplies the Website settings required for the ASP.Net web sites. These settings are like connection strings, how many users allowed, etc. Sometimes the situation arises where we need to add or remove the configuration settings without re-starting the server. This is to avoid website’s down-time. In this article, we will see a demo of how to change web config file when the site is running. Imagine that web admin of the site will access the page which we will create in this example. The goal is to add an extra web setting dynamically, and in the meantime, the server must function as usual with no re-start.

File Processing using CreateFile, ReadFile and WriteFile Win32 APIs

Win32 CreateFile Example

In this article, we will look at the example of using the CreateFile, ReadFile, WriteFile and OpenFile win32 API functions with an MFC Dialog based application. Win32 is a very rich API that supplies many functions and MFC is a Framework wrapped over those functions to form a logical working unit. Win32 API library is in a native format that means it is in C style (Procedural Approach) whereas MFC is an OOPS based Framework API. OK, let us start with the sample.

Send Message to Microsoft Message Queue (MSMQ) – C# Example

Microsoft Message Queue (MSMQ)

Message Queues allows data exchange between one or more application and in the meantime, it won’t force the application being communicated should be in live connection. Application 1 can send a message and quit or do another task. Application 2 when free looks at the queue and catches the passed-in information. MSMQ can maintain one or more queue. In the above picture, we can see three queues. We will develop a sample in this article, which will send and receive the information through the MSMQ as shown above. In our example, we will use only one queue, say Q1. However, one can create multiple queues based on the need.