Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
23 views7 pages

Section - A Answer Any FOUR Questions

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 7

SECTION -A

Answer any FOUR questions:

Common Language Runtime: CLR is the virtual machine component


Df Microsoft's .NET framework that manages the execution of .NET

It is used to get or set name of the current DataSet. It is used to get a custom view
of the data contained in the DataSet to allow filtering and searching.

SQL stands for Structured Query Language. SQL is a programming language


designed for managing, manipulating,and retrieving data.

The parentElement property returns the parent element of the specified element.

SECTION -B

Answer any FOUR questions:

The OracleDataAdapter is a class in the ADO.NET framework provided by Oracle


that acts as a bridge between a DataSet object and an Oracle database. It is used to
retrieve data from an Oracle database and fill a DataSet object with that data, or to
update the data in an Oracle database based on the changes made to a DataSet.
• A Data Adapter represents a set of data commands and a database
connection to fill the dataset and update a SQL Server database.
• A Data Adapter contains a set of data commands and a database connection
to fill the dataset and update a SQL Server database.
• Data Adapters form the bridge between a data source and a dataset.
• Data Adapters are designed depending on the specific data source.
• The following table shows the Data Adapter classes with their data source.

SqlConnection: This class establishes a connection to a SQL Server database.


Methods: Open(), Close(), Dispose()

SqlCommand: This class executes a SQL statement against a SQL Server


database.
Methods: ExecuteNonQuery(), ExecuteScalar(), ExecuteReader()

SqlDataReader: This class reads data from a SQL Server database.


Methods: Read(), Close(), GetValues()

SqlDataAdapter: This class fills a DataSet or DataTable with data from a SQL
Server database.
Methods: Fill(), Update()

SqlTransaction: This class manages a transaction in a SQL Server database.


Methods: Commit(), Rollback()

SqlParameter: This class represents a parameter used in a SQL statement.


Methods: None
System.Xml The overall namespace for the .NET Framework classes provide
standards-based support for parsing XML

System.Xml.Xsl
Contains classes that provide support for XSLT transformations

System.Xml.XPath
Contains classes that provide support for executing XPath queries

System.Xml.Schema
Contains classes that provide standards-based support for W3C XML schemas

System.Xml.Serialization
Contains classes that are used to serialize and de-serialize .NET Framework
objects to and from XML

A namespace simply provides a named group of


classes, structures, enumerations, delegates, interfaces and other namespaces.
Within the namespace, all declared items must be uniquely named. However, the
same name may be duplicated in different namespaces.

Syntax
Namespaces are declared using the namespace keyword.

namespace namespace-name {}

Namespace Example
namespace FirstNamespace
{
class Test
{
public void ShowMessage()
{
Console.WriteLine("This is the first namespace!");
}
}
}

SECTION -C

Answer any TWO questions:

Definition: ADO is a rich set of classes, interfaces, structures and enumerated


types that manage data access from various types of data stores.
• Enterprise applications handle a large amount of data.
• This data is primarily stored in relational databases, like Oracle, SQL
Server, Access and so on.
• These databases use Structured Query Language (SQL) for retrieval of
data.
• This interface acts as a bridge between an RDBMS system and a .Net
application. ADO.NET is such an interface that is created to connect
.NET applications to RDBMS systems.
• In the .NET framework, Microsoft introduced a new version of ActiveX
Data Objects (ADO) called ADO.NET.
• Any .NET application, either Windows based or web based, can interact
with the database using a rich set of classes of the ADO.NET library.
• Data can be accessed from any database using connected or disconnected
architecture.
• There were many data access technologies available prior to ADO.NET,
primarily the following:
1. Open Database Connectivity (ODBC)
2. Data Access Objects (DAO)
3. Remote Data Objects (RDO)
4. ActiveX Data Objects (ADO)
• ADO is a simple component based object-oriented interface to access data
whether relational or non-relational databases. It is a successor of DAO
and RDO.
• ADO reduces the number of objects. Their properties, methods and
events.
• ADO.NET provides mainly the following two types of architectures:
1. Connected Architecture
2. Disconnected Architecture

I. Connection Oriented Architecture

→In this case we require a continuous connection with the Data


Source for accessing data in it.

→Here the “DataReader” class holds the data on client machines.


Disconnected Oriented Architecture

→In this case we do not require a continuous connection with the Data Source
for accessing data.

→Here the “DataSet” class holds the data in the client machines.
using System;
using System.Web;

namespace CookieManagementDemo
{
public partial class Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{

if (Request.Cookies["username"] != null)
{

string username = Request.Cookies["username"].Value;


lblMessage.Text = "Welcome back, " + username + "!";
}
else
{
pnlForm.Visible = true;
}
}
}

protected void btnSubmit_Click(object sender, EventArgs e)


{

HttpCookie cookie = new HttpCookie("username");

cookie.Value = txtUsername.Text;

cookie.Expires = DateTime.Now.AddDays(7);

Response.Cookies.Add(cookie);

lblMessage.Text = "Welcome, " + txtUsername.Text + "!";

pnlForm.Visible = false;
}

protected void btnLogout_Click(object sender, EventArgs e)


{

HttpCookie cookie = new HttpCookie("username");


cookie.Expires = DateTime.Now.AddDays(-1);
Response.Cookies.Add(cookie);

pnlForm.Visible = true;
}
}
}

You might also like