Recent Posts - page 2

  • SQL-CLR Function – Creating & Using it

    Configure SQL CLR and Create Assembly using T-SQL - Refer Code Listing 2

    First, database developers write the functions in Dotnet framework and then expose that via a DLL. The SQL server, then loads the DLL into DB engine and starts picking up functions exposed by it. In native SQL language, one can write functions, stored procedures, and triggers. In Dotnet framework, besides these, one can write custom Aggregate Functions and can even define own User-defined Types.

    Using the Surface Area Configuration tool, one can ask SQL server to allow the injection of Dotnet Framework code in its core engine. This tool ships with the SQL Server installer. The below given steps show enabling the SQL-CLR integration via this tool.

  • Java Exception Multiple Catch Blocks

    Try Block Raising Multiple Exceptions

    We know that a try block in Java will have a matching catch block. Now, we see how to use multiple catch blocks. Have a look at the picture.

    The picture shows there are three code snippets within the try block. Let us assume code snippet 2 depends on code snippet 1 and code snippet 3 depends on code snippet 2. We will also assume each code snippet has the possibility of one exception type. From the picture, we can assume the exception types are A, B and C.

  • Executing SQL Stored Procedure in ADO.Net

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

    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.

  • Java Exception Handling: Try Catch Finally

    Separating Error Handling Code

    When application crashes the JVM excludes it from any further execution. This means application halts abruptly. In Java Exception Handling is useful to avoid application crashes. Exception handles error condition and takes a safer path in the execution flow. The exception also makes code more readable as the error handling code stays in a separate section from the normal business logic code. In this example, we will see how to handle exception using Try & Catch blocks. We will also see the role of Finally block.

  • Asp.Net – Navigation Control Example

    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.