Articles on C# programming language.

ADO DataGridControl Example
Ado.Net

ADO DataTable & DataGridControl

In this Article, we will see an example which pulls data from the database and displays that in the Dotnet Windows Form using ADO DataTable, DataAdapter and DataGridControl. The control at the top of the form is DataGridControl. We will use this control to display the data in the DataTable. In this example, we are going to load the data to the DataTable through DataAdapter and then going to display it in the DataGridControl. This action happens twice in this example and one is at the form load and another one is at the Reload button click.

DataGrid Control and SqlDataSource
Asp

Filter Datagrid Data Via DropDown List Selection

Here, in this example, we have two SqlDataSource Controls and they both tied to Authors table of the Pubs database. The first data source control (Marked as 1) supplies data for the grid control (Marked as 3). The second data source control (Marked as 2) supplies the data to the combo box control (Marked as 4). When a user selects a state in the combo box, the DataGrid will update the authors listed in the DataGrid.

Example - CAS Method Level Security
C#

Method Level CAS (Code Access Security)

The Method Level Security comes with different Security Actions and those are below: 1. Demand Action 2. Link Demand Action 3. Inheritance Demand Action 4. Deny Action 5. PermitOnly Action 6. Assert Action The text boxes (Markers 1 & 2) will display the value of the environment variables UserName and SecTest. The two read buttons (Markers 3 & 4) try to read those environment variables and sets the retrieved values in the corresponding text boxes 1 and 2. The Radio button options (Marker 5) invoke the methods which had applied with the corresponding security attributes. We are going to debug the methods by picking an option here (marker 5) and hitting the Read buttons. The check box (Marker 6) is used to explain how the security actions like Deny and Demand are invoked through imperative method. One can use the same imperative style for other security actions as well.

About-this-Ado.Net-Stored-Procedure-Example
Ado.Net

Executing SQL Stored Procedure in ADO.Net

In this example, we placed a multi-line text box control in the top portion of the sample application (Marked as 1) and this control shows the data returned by executing the stored procedure. The clear button (Marked as 2) will clear the current content in the multi-line text box. The button marked as 3 in the example executes the stored procedure listed in listing 1.1. Button marked as 4 is used to execute the stored procedure which accepts parameters (Listing 1.2). Two text box items (Marked as 4 and 5) supply the parameters for the stored procedures in listing 1.2 and 1.3. The button marked as 7 in our example executes the stored procedure that has a return statement and accepts output parameters (Listing 1.3). The value received is shown in the labels marked as 8 and 9. That is all about this example application and you can see the video at the end of this article to see how it works.

Asp.Net Navigation control Example
Asp

Asp.Net – Navigation Control Example

The Navigation Controls are useful for maintaining the page hierarchy as well as the page navigation in ASP.Net. There are three navigation controls that one can use in ASP.Net 2.0 and above. These controls are:

1) SiteMapPath
2) Menu
3) TreeView

The item marked as one shows the usage of the Menu Navigation control. The menu can be laid horizontal or vertical. In our example, the menu has the horizontal direction. Item marked as 2 in the example shows the TreeView Navigation Control and it shows the Navigational link and the hierarchical Relation between them. If you see here, the site groups the links under the country names. The items marked as 3 show the usage of the SiteMapPath Navigation Control. The path navigation control helps the user to know which page they are viewing. This is handy in a big site, and the user can know the path to that page from the top-level of the page. All these controls together express the usage of the navigational control on ASP.Net 2.0 and above.