2076

CSC378 · TU past paper

NET Centric Computing 2076 question paper

The complete TU 2076 exam paper for NET Centric Computing (CSC378), all 15 questions with solved model answers written to the mark scheme.

Tap a question to open its answer.

  1. 15 marksASP.NET and ASP.NET MVCAnswer

    Explain the components of ASP[5]

    ASP.NET Core is designed to separate web logic, infrastructure, and core components from each other to provide a more development-friendly environment. The main components are organized into distinct layers. --- - This layer encapsulates...

  2. 25 marksCommon client-side web technologiesAnswer

    Explain the client-side scripting with practical example.[5]

    Client-side scripting refers to scripts that are executed on the client's browser rather than on the web server. The script is downloaded along with the HTML page and runs locally on the user's machine without requiring a round-trip to t...

  3. 35 marks.NET and ASP.NET frameworksAnswer

    What do you mean by Microsoft Net framework? Explain with example.[5]

    Microsoft .NET Framework

    Definition

    The .NET Framework is a software development platform developed by Microsoft that provides a controlled programming environment where software can be developed, installed, and executed on Windows-based operating systems. It provides tools and libraries for building and running applications using multiple programming languages such as C#, F#, and Visual Basic.

    The .NET ecosystem includes several implementations:

    • .NET Framework (original Windows-based platform)
    • .NET Core (modern, cross-platform version)
    • Mono (open-source, cross-platform implementation)

    Key Components of .NET Framework

    1. Common Language Runtime (CLR)

    The CLR is the execution engine of .NET. It manages code execution, memory management, and security. Code written in .NET languages is compiled into Intermediate Language (IL), which the CLR then executes.

    2. Class Libraries / Base Class Library (BCL)

    A large collection of reusable classes, interfaces, and value types that provide common functionality to all .NET applications.

    3. Application Models / Technologies

    TechnologyPurposeExample
    Win FormsForm-based desktop applicationsNotepad-like client apps
    ASP.NETWeb-based applicationsRuns on Chrome, Firefox, etc.
    ADO.NETDatabase interactionOracle, Microsoft SQL Server

    .NET Core (Modern Version)

    .NET Core is the newer, improved version of the .NET Framework. It is:

    • Open-source -- maintained by Microsoft on GitHub under MIT and Apache 2 licenses
    • Cross-platform -- runs on Windows, macOS, and Linux
    • Modular and lightweight -- written from scratch for performance
    • Supports multiple languages -- C#, F#, Visual Basic
    • Wide range of applications -- mobile, desktop, web, cloud, IoT, games, machine learning
    • Consistent across architectures -- x64, x86, and ARM

    Mono

    Mono is another example of a cross-platform .NET implementation available on Windows, macOS, Linux, and more. It was originally designed as an open-source implementation of .NET Framework on Linux.

    Example: The Unity game engine uses C# through Mono as a cross-platform way of creating video games. Mono provides the means to compile and run C# programs, similar to the .NET Framework.


    Simple Example (C# Console Application on .NET Core)

    using System;
    
    namespace HelloDotNet
    {
        class Program
        {
            static void Main(string[] args)
            {
                Console.WriteLine("Hello from .NET Framework!");
                Console.WriteLine("Platform: Cross-platform with .NET Core");
            }
        }
    }
    

    Output:

    Hello from .NET Framework!
    Platform: Cross-platform with .NET Core
    

    This simple program can be compiled and run on Windows, macOS, or Linux using .NET Core, demonstrating the cross-platform nature of the framework.


    Summary

    FeatureDescription
    DeveloperMicrosoft
    Languages SupportedC#, F#, Visual Basic
    Platform (.NET Core)Windows, macOS, Linux
    Application TypesWeb, Desktop, Mobile, Cloud, IoT, Games
    Open SourceYes (.NET Core on GitHub)

    The .NET Framework (and its modern evolution .NET Core) provides a unified, powerful, and flexible environment for building a wide variety of applications across multiple platforms.

  4. 45 marksSetting up the EnvironmentAnswer

    What are the ASP requirements?[5]

    ASP.NET (Active Server Pages .NET) is a web application framework developed by Microsoft for building dynamic web applications and services. To develop and run ASP.NET applications, the following requirements must be met: --- - ASP.NET a...

  5. 55 marksCommon client-side web technologiesAnswer

    Differentiate between client-side and server-side script.[5]

    Client-Side Script refers to code that is executed on the user's browser (client machine). The script is downloaded from the server and runs locally on the browser without any server interaction. Server-Side Script refers to code that is...

  6. 65 marksADO.NET basicsAnswer

    What is ADO in ASP?[5]

    What is ADO in ASP?

    ADO (ActiveX Data Objects)

    ADO is a Microsoft technology used in Active Server Pages (ASP) to connect web applications to databases. It provides a set of COM-based objects that allow developers to access and manipulate data stored in databases (such as MS Access, SQL Server, Oracle, etc.) from within ASP pages.


    Key Features of ADO

    • ADO stands for ActiveX Data Objects
    • It is used to connect, retrieve, insert, update, and delete data from a database
    • It works with OLE DB providers to communicate with various databases
    • It is a part of Microsoft's Universal Data Access (UDA) strategy
    • It is simple, fast, and easy to use in classic ASP pages

    Main ADO Objects

    ObjectDescription
    ConnectionEstablishes a connection to the database
    RecordsetHolds the data retrieved from the database (like a table of rows)
    CommandExecutes SQL queries or stored procedures
    ErrorContains details about data access errors

    How ADO Works in ASP (Steps)

    1. Create a Connection object to connect to the database
    2. Open the connection using a connection string
    3. Create a Recordset object to hold query results
    4. Execute SQL queries to retrieve or manipulate data
    5. Process the data (display, update, delete)
    6. Close the Recordset and Connection to free resources

    Example Code (Classic ASP with ADO)

    <%
    ' Step 1: Create Connection Object
    Dim conn, rs, sql
    Set conn = Server.CreateObject("ADODB.Connection")
    
    ' Step 2: Open Connection
    conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\mydb.mdb"
    
    ' Step 3: Create Recordset Object
    Set rs = Server.CreateObject("ADODB.Recordset")
    
    ' Step 4: Execute SQL Query
    sql = "SELECT * FROM Students"
    rs.Open sql, conn
    
    ' Step 5: Display Data
    Do While Not rs.EOF
        Response.Write rs("StudentName") & " "
        rs.MoveNext
    Loop
    
    ' Step 6: Close Objects
    rs.Close
    conn.Close
    Set rs = Nothing
    Set conn = Nothing
    %>
    

    Connection String Components

    A connection string typically includes:

    • Provider - the OLE DB provider name
    • Data Source - path or server name of the database
    • User ID and Password - credentials (if required)

    Advantages of ADO

    • Easy to use and implement in ASP pages
    • Supports multiple database types through OLE DB providers
    • Allows both connected and disconnected data access
    • Supports CRUD operations (Create, Read, Update, Delete)
    • Lightweight and fast for web-based database access

    Summary

    ADO in ASP is a data access technology that acts as a bridge between an ASP web application and a backend database. It uses objects like Connection, Recordset, and Command to perform database operations efficiently, making it a fundamental component of classic ASP-based web development.

  7. 75 marksAnswer

    What is VB Script in ASP?[5]

    VB Script in ASP

    Definition

    VBScript (Visual Basic Scripting Edition) is a lightweight scripting language developed by Microsoft, based on Visual Basic. In the context of Active Server Pages (ASP), VBScript is the default scripting language used to write server-side scripts that are executed on the web server to generate dynamic HTML content sent to the client's browser.


    Key Characteristics of VBScript in ASP

    1. Server-Side Execution

    VBScript code embedded in ASP pages is executed on the server, not on the client browser. The server processes the script and sends only the resulting HTML to the browser.

    2. Syntax and Delimiters

    VBScript code in ASP is enclosed within special delimiters:

    <% VBScript code here %>
    

    Or using the script tag:

    <script language="VBScript" runat="server">
        ' code here
    </script>
    

    3. Basic Example

    <%
        Dim strName
        strName = "TU CSIT Student"
        Response.Write("Hello, " & strName)
    %>
    

    Output sent to browser:

    Hello, TU CSIT Student
    

    Features of VBScript in ASP

    FeatureDescription
    Default LanguageVBScript is the default scripting language for Classic ASP
    Case InsensitiveVariable names and keywords are not case-sensitive
    Loosely TypedAll variables are of type Variant; no need to declare data types
    Built-in ObjectsWorks with ASP built-in objects like Request, Response, Session, Application, Server
    InterpretedScripts are interpreted at runtime on the server
    No CompilationDoes not require pre-compilation like compiled languages

    VBScript with ASP Built-in Objects

    VBScript interacts with ASP's built-in objects to handle web functionality:

    <%
        ' Reading form data using Request object
        Dim username
        username = Request.Form("username")
    
        ' Writing output using Response object
        Response.Write("Welcome, " & username)
    
        ' Using Session object
        Session("user") = username
    %>
    

    Conditional and Loop Example

    <%
        Dim i
        For i = 1 To 5
            Response.Write("Number: " & i & " ")
        Next
    %>
    

    Output:

    Number: 1
    Number: 2
    Number: 3
    Number: 4
    Number: 5
    

    Advantages of VBScript in ASP

    1. Easy to learn for developers familiar with Visual Basic
    2. Tight integration with Microsoft technologies (IIS, COM objects)
    3. Dynamic content generation -- pages change based on user input or database data
    4. Access to databases through ADO (ActiveX Data Objects)
    5. Reusable code through procedures and functions

    Limitations

    1. Runs only on Microsoft IIS server (not cross-platform)
    2. Slower compared to compiled languages
    3. Replaced by ASP.NET which uses VB.NET or C# for more powerful server-side development

    Summary

    VBScript in ASP provides a simple, powerful way to create dynamic, data-driven web pages by embedding server-side scripting logic directly within HTML. It uses ASP's built-in objects to handle requests, responses, sessions, and server operations, making it the foundation of Classic ASP web development on Microsoft platforms.

  8. 85 marksTry statements and ExceptionsAnswer

    Explain error handling in ASP.[5]

    Error handling (Exception Handling) in C is a mechanism to detect and handle run-time errors in code. The CLR (Common Language Runtime) supports error and exception handling as one of its core responsibilities. C provides three keywords ...

  9. 95 marksApp Servers and Hosting modelsAnswer

    Differentiate between ASP and IIS.[5]

    --- ASP is a server-side scripting technology developed by Microsoft that allows developers to create dynamic web pages and web applications. It processes scripts on the server before sending the result (HTML) to the client's browser. II...

  10. 105 marksApp Servers and Hosting modelsAnswer

    Explain the virtual directory properties in ASP.[5]

    A Virtual Directory in ASP (Active Server Pages) is a directory name (alias) used in a URL that corresponds to a physical directory on the server. It allows web applications to be organized and accessed without exposing the actual physic...

  11. 115 marksServer-side strategiesAnswer

    Explain about request object and session object in ASP.[5]

    --- The Request Object in ASP.NET is part of the HttpContext object, which holds information about the current HTTP request. Whenever a new HTTP request is made, the HttpContext object is created, capturing the current state of that HTTP...

  12. 125 marksServer-side strategiesAnswer

    Differentiate between application object and server object in ASP.[5]

    --- Basis Application Object Server Object --------- Definition The Application object is used to store and share information that is accessible to all users across the entire web application. The Server object provides properties and me...

  13. 135 marksFile IOAnswer

    Explain about file access with ASP with example.[5]

    File access in ASP.NET allows web applications to read from and write to files stored on the server. ASP.NET provides built-in classes through the System.IO namespace to handle file input/output operations. The two main streams used are:...

  14. 145 marksAnswer

    What do you mean by debugging ASP? Explain.[5]

    Debugging in ASP.NET refers to the process of identifying, analyzing, and fixing errors (bugs) in an ASP.NET application. It involves examining the code execution flow, inspecting variable values, and tracing program behavior to locate t...

  15. 155 marksAnswer

    Explain the sending and receiving e-mail with ASP with example.[5]

    ASP.NET provides built-in support for sending and receiving e-mails using the System.Net.Mail namespace. This namespace contains classes that allow web applications to send e-mail messages through an SMTP (Simple Mail Transfer Protocol) ...