Professional Documents
Culture Documents
(CS)TY
Unit I-1ntroductio
UnitI
Introduction
Introduction
*
CH.Net akshuypawle@gail.com
Jnit I- Int
oduction Sc.(CS)
B.Sc.(CS) TY
Types of Framework-
Application
CE platfo n. (E.g.
Windows
Framework Type on
Sr. No. Compact P'ramework
It is
available
Microwayve
Smartphone) devices. (E.g.
cmbedded
in
It is uscd
Micro Framework
Oven) plug-1n.
Web Browser
It is used for and game
Silverlight operating system
for smartphone
lt is used
4 Mono l'ramework
engines.
Cloud Computing,
Core Framework It is used in
* .Net Architecture- to
platform introduce by Microsoft
is
programming language, it
a
Dot Net (.Net) is not a
VB C CJScript
Common Language Speciflcation
ADO.NETandXML
Base Class Lbray
Compnon Language Runtime
OperatingSystem
1).Net Languages
Net technology supports different types of languages such a[ CH/VB,) etc. to develop
various types of applications.
CTS and CLS are parts of.NET CLR and are responsible for type- safety within the code.
CH.Net akshaypawle@gmail.com
2) CLS-
Common Language Specificatioh and it is subset o/CTSI defines
a a
CLS stands for
under NET framcwork.
set of rules and restrictions that every languagemust follow which runs
3) CTS-
lt stands for Common Type Specification. CTS defines how data types are declared, usedb
and managed in the runtime. t facilitates cross-language integration. he rules delined in CTS
can be used to define your own classes and values.
4) a) ASP.NET-
ASP.NET is used to creale dynamic Web applications and is the successor lo ASP.
such
2) Web services are part of ASP.NET and beneficial for open standards,
as
6) Windows Forms -
based activities.
5) a) ADO.NET -
It provides support for data access in Microsoft .NET. It standls lor ActiveX Data Object.
b) XML- It stands for Extensible Markup Language. XML is the temporary data storage of the
database used for web applications.
6) Class library-
The NET Framework includes a set of standard class libraries. These class libraries
implement a large number of common functions, such as file reading and writing, graphic
CH.Net ukshaypawle@gmail.com
ProfesstonalxeroxCocsit Laiur
Unit I-1ntrodu ction .Sc.(CS)
B.Sc.(CS) TY
built in classes
Most 0f the
hierarchy of
namespaces.
in a 1s divided into two
T he class library is organized The class library
namespaces.
cither System, or
Microsoft.
arepart ofl Library.
Framework Class
parts: the Base Class Library and the
and refers to
of the BCL classes
It is a superset
Class Library (FCL)
-
(WF).
class library. For
Base Class Library (BCL) small subset of the entire
It includes a
b)
-
reside in mscorlib.dll,
.NET Framcwork most classes considered being part of BCL
System.dll and System.Core.dl
the code exccution of the program. The CLR is a runtime engine that handles memory
allocation, security, code verification, type verification, exception handling, and garbage
collection.
8) Operating System -
It is a system software, which acts as an interface between computer user and computer
hardware. Operating system supports to CLR to execute .Net applications.
*IntelliScense-
IntelliScnse is a code completion tool that is built into Microsoft Visual Studio. Auto
completing is
way toone offer a productive and
programmer friendly user interface to
programmers and IntelliSense feature of Visual Studio .NET is one of them.
1)-List Members-
A list
of valid)members from a type appears after you type a
continue typing characters, the list is filtered to period character (.). If you
include only the members that
characters. After selecting an item, you begin with those
can insert it into your code by
a space. pressing Tab or by typing
CH.Net
akshaypawle@gmail.com
btion
BSc.(CS) TY Unit 1-Introduction
In the member list, the icon to the lelft represents the type of the member, such as
namespace, class, function, or variable. You can invoke the List Members leature manually by
typing Ctrl I J, choosing Edit > 1IntelliSense> List Members, or by choosing the List Members
button on the editor toolbar.
buttonl
Acces sibilityObject
AccessibleDefaultActionDescript
AccessibleDescription
AccessibleName
AccessibleRole string ButtonBase.Text
AllowDrop
Anchor
AutoElliptis
AutoScrollOffset
2) Parameter Info -
Parameter Info gives you information about the number, names, and types of paramelers
required by a method. The parameter in bold indicates the next paramcter that is required as you
HessageBox . Show(|
You can manually invoke Parameter Info by choosing Edit > IntelliSense > Parameter
toolbar.
3) Quick Info -
Quick Info displays the complete declaration for any identifier in your code. When you
select a member from the List Members box, Quick Info also appears.
You can manually invoke Quick Info by choosing Edit > IntelliSense > Quick Info, by
escege5o
dass System.Windows.Forms.Messageßox
that inform and instruct the user.
Displays a message box that can contain tet, buttons, and symbols
CH.Net akshaypawle@gmail.com
Cocsit Latur
Professionalxeroxc
Unt Sc.
(CS7
UUtcttOn
6Win
)
B.Sc.(CS) 7Y
function
name after vos
u
or
Complete
Word completes the term.
or by choosing the
disambiguate
Ctrl + Space,
characters to
Chtercd enough
Word, by pressing
C >
IntelliSense>
Complete
choosing Fdit
button on the editor toolbar.
Complete Word
C#.NE1,
with
*Project Types that can be created
the different projects
roloWIngare
some
ne
) Console applications
2) Windows Applications
3) Webapplicationis
4)Webservices
5) Class library
6)Windows Control Library
7) Weh Control Library
1) Consolc Application
-
2) Windows Applic:ation
It is a form based standard desktop application for common day to day tasks such as
inventory management system, college management system and many more.
3) Web Application
It is
client-server computer program which the client runs in a web browser.
a
Common
web applications include webmail, online retail sales, online
auctions, and many more.
4) Web services
Web services are web
applications that provide services to other applications over the
internet. Web service is a language
independent of way communication.
5) Class Library
ClassLibrary contains classes, intertaces, and value
applications. A Class library cannot be executed and thus it does types
to be used inside other
not have any entry point.
CH.Net
akshaypawle@gmail.com
6
roduction Unit I- Introduction
B.Sc(CS) TY
of
the responsibility ol the CLR to take care
It is the heart of the NET framework. It is
a runtime engine that
handles memory
the code execution of the program. The CLR is
verification, exception handling, garbage collection
allocation, security, code verification, type ww
Class Loader
1. Class Loader -
It is used to load all the classes at runtime for execution of .Net application.
3. Code manager
It manages the code during execution.
CH.Net akshaypawle@gmail.com
CS) TY
5.Output Window
6. Solution F
7.Proper
roduction Unit I-Introduction
B.SefCS)
TY
5. Output Window
6. Solution Explorer
7. Properties Window
bndm*dta1
A u
twiwo
***
1. Menu Bar -
2. Standard Toolhar-
contains butlons that are bound to
A standard toolbar is a horizontal or vertical strip that
commands.
3. ToolBox -
4. Forms Designer
When you create a new project that is a Windows application, Visual Studio .NET will
open the project in Designerview, The Form Designer is usually the windows.in the middle of
CH.Net akshuypawle@gmail.com
menu
the
environment
Irom the vView
Visual Studio NET
the
also select the Designer option put
application's form object. You can
5. Output Window -
teatures in the integrated
status messages
for various
1he Output window can display
window, on the menu bar, choose
development environment (IDE). To open the
Output
View/Output (or click CTRL + ALT + 0).
6. Solution Explorer-
Solution Explorer is a tool window in the Visual Studio integrated development
environment (1DE) that displays the contents of a solution, which includes the solution's projects
and each
project's items.
In Visual Studio .NET, a solution is a set of one or more projects that are part of the same
applicatioi1. Tlhe Solution Explorer window shows you an expandable list of projects, cach
project's references, and cach project's
components. If this window is closed, you can open it by
selecting the View. Solution Explorer menu item.
Components may be made up of forms, classes, modules, and
to create any other file tyypes it takes
your application. Double-click an item in order to edit that item within the IDE.
7) Propertics Window
Use this window to view
and change the
objects that are located in editors and design-time properties and events of selected
menu. You can also
designers. You can find
Properties Window on the View
it
open by pressing F4.
Once this window is
visible,you can either view the list
attribute. Some
properties within this widow can be selected alphabetically or categorized by
click a button that from a list; others
brings up a dialog box. Still others allow you to
text box. require you to supply text by
typing into a
CH.Net
akshaypavele@gmail.com
10
B.Sc.(CS) TY
Unit 1- Introduction
Java vs C# -
Java CH (Sharp)
1) Java object-oriented programming 1) C# is an object-oricnted programming
is an
type type.
CH.Net akshaypanvle@gmail.com 1
B.Sc.(CS) TY
Unir VI- Dutabase Connectivity
Unit VI
Database Connectivity
* Introduction ADO.Net-
ADO
stands for ActiveX Data Obiects. ADO.NET is a database technology
ewoTK o or ne
used to connect application system and database server ADO.NET is a part
.NET Framework. ADO.NET consists
ofa set of classes used to handle dala
acces
The
following figure shows the ADO.NET objects at a
glance
Connection
Command
Application Data Source
DataReader
DataSet DataAdapter
System.Data namespace is the core of ADO.NET and it contains classes used by all data
providers.
1) Data Providers
A key component of an ADO.NEJ is Data l'rovidcr. The Data Providcr classcs arc meant
to work with different kinds of data sources They are used to perform all
data-management
operations on specific databases.
The Net Framework includes nainly three Data PrOviders for ADO.NET.
They are the
Microsoft SQL Server Data PrOvider, OLEDB Data Provider and ODBC Data
Provider. SOL
Sérver uses the SqIConnection object, OLEDB uses the OleDbConnection
Object and ODBC
uses Odbc Connection Object respectively.
CHNet akshaypawle@gmail.com
Latur
B.Sc:(CS) T
Connection
Source.
Data
connection to the
to it properly,
log on
2) Connection
physical and to
Connection Object provides the data
source
The recognize
i n f o r m a t i o n to
the necesary
string.
object needs a
connection
4) DataRcader-
retrieval of query
The DataReader Object is a stream-based, forward-only, read-only
Iesults from the Data Source, which do not update the data. DataReader requires a ive
51 DataAdapter-
DataAdapter Ohject populates a Datasct Object with results from a Dala Source. It is a
special class whose purpose is to bridge the gap between the disconnected Dataset objccts and
the physical data source.
6) DataSct -
DataSct class provides mechanisms for managing data when it is disconnected from the
data source It is completcly independent fromthe Data Source, DataSct provides much greater
flexibility when dealing with related Result Sets.
*Advantages of ADO.Net -
1)Scalability -
ADO.NET provides
full support for disconnected data
access., In this type of data access,
most of the time the data we are
working with is not connected to a data sourc
CH.Net
akshaypanele@gmail.com
Maintcunolbility Uge N-tie+ application Iogrc ace
rhdsls NdoeRE Coooecuoeotg, So/te
ta
maintai n seveka useA tequestS
ad cuh nma ties to me
eSSZornalerox Cocsit La
B.Sc(CS)TY EotammibilitySttongly ty ped datu &egsy to wtrle Code
because mictosot Ufsucd Stu Unit Vi- Datubuse
Connectivity
2) Data Source dio-0et feameuootk PEOuides
Independence- Stademernd opioMS
The fundamental object that holds data in AD0.NET
is object of the class Data Set.
an
This class is present in the
SOurceand
namespace.System.Data. DataSet is completely indepcndent of data
a
no way DataSct controlled by the data source as it
is
happens in case of RecordSet.
3)Interoperability
As ADO.NET transmits the data using the format of XML which is not
ADO.NET or windows platform. dependent on
4) Performance
Less processing time is needed for data conversion in the
case of ADO.NET, as data
lransmission occurs via XML. Tlhis iesults in better per formance of the busincss application that
is developed with the help of ADO.NET.
5) Firewall-
AS in ADO.NET transmission is via XML
format, there fore il can pass th1rough fiiewalls.
6) XML
ADO.NET programs take
can
advantagc of the flexibility and broad acccptance of
Extensible Markup I.anguage (XMI.). XML is the
format for transmitting datasets across the
network, so any component that can read the XML format
can process data.
RN Name Fees
Amol 1000
Dalaji 2000
Chetan 3000
roll number
Unit 6
RN
Delete
Property Table-
Control Property
Name Text
Labell RN
textBox txt_rn
button btn_delete Delete
button2 btn exit Exit
using System.Data.OleDb;
namespace simpleADO
public Form1()
InitializeComponent( )
Net akshaypavwle@gmail.com A
Application.Exit( );
The SQL SELECT statement returns a result set of records from one or more tables.
Fees 2000
CHNet
akshaypawle@gmail.com
Control Property
Name Text
Labell RN
Labell Name
Labell Fees
textBox1 txt_rn
textBox2 tXt_name
textBox3 Ixtfees
buttonl btnsearch Search
using System.Data.OleDb;
public Form1()
InitializeComponent( );
OleDbConnection con =
new OleDbConnection ("Provider
Microsoft.Jet.oledb.4.0;
=
Data Source =
d:|lcollege.mdb"):
con.Open()
string query= "select *
from student where rn =" +
txt_rn.Text;
OleDhCommand cmd= new OieDbCommand(query, con);
OleDbDataReader dr cmd.ExecuteReader( );
=
if(dr.Read(O)
txt_name.Text = dr["name"].ToString();
txt_fecs.Text=dr["fees"].ToString();
CH.Net
akshaypawle@gmail.com
B.Sc.(CS) TY
else
txt_clear( )
con.Close( ):
b) Table Updating-
An SQL UPDATE statement changes the data of one or more records in a table.
Program Write a program for demonstration of modifying or updating data from database.
Updating Data
RN
Name
Fees
*****
Update Ext
Property Table-
Control Property
Name Text
Labell RN
Label2 Name
Fees
Label3
akshaypawle@gmail.com
CH.Net
namespace updateData
public Forml()
InitializeComponent( :
OlcDbConnection con =
new
OleDbConnection("Provider Microsoft.Jet.oledb.4.0;
=
Data Souree =
d:\\college.mdb")
con.Open()
string query= "update student set name =" "+ txt name.Text "
+ '
fees= + Ixt fecs.Text +"' where rn ="
"
d.ExccuteNonQuery( );
MessagcBox.Show("Record is updated");
con.Closc( ):
C#.Net
akshaypawle@gmail.com
Unit VI-Databuse Connectivity
B.Sc.(CS) TY
Disconnected Data Access through Dataset Objects-
The ADO.NET Framework supports two models of Data Access Architeclure, connected
and disconnected modes.
A connected mode of in ADO.Net is in
unde
operation one
which the connection to the
yng database is alive throughout the lifetime of the
operation. Meanwhile, a disconnected
s operation is one in which ADO.Net retrieves data from the underlying database, stores
the data retrieved
etrieved temporarily in the memory, and then closes the connection to the database.
0.Net provides a new solution by introduce a new component called Dataset. The
h e central component in the ADO.NET Disconnected Data Access Architecture. It
Old multiple tables at the same time. DataSets only hold data and do not interact with a
Data Source.
onnection Oriented Data Acces, when you read data lrom a
Datakeader
dalabase by using a
object, an open
connection must be maintained between your application and
Data Source.
Unlike the DataReader, the DataSet is not connected the
through a Connection object when dircctly to a Data Source
t
you populate it.
is the
c
DataAdapter that manages connections between Data Source and Dataset by fill
data irom Data Source to the Dataset and giving a disconnected
DataAdapter acts as a bridge behavior to the Dataset. The
between thhe DataSet and Data Source.
Program Write a
program for demonstration of disconnected data
dataset object.
access through
Databasejconnecuyity
Disconnected Mode
RN Name Fees
Ano 1000
Balaj 2000
**
Chetan 3000
C#.Net akshaypawle@gmail.com 9
Unit VI- Database Connectivity
B.Sc.(CS) 7Y
using System.Data.OleDb:
namespace disconnectedAccess
1Forml: Form
public partial class
public F'ormI()
InitializeComponent( );
Data Source =
d:\\eollege.ndb");
con.Open( ):
stringquery= "select * from student";
OleDbDataAdapter da =
new
OleDbDataAdapter(query, con);
DataSct ds =
new DataSet( );
da.Fill(ds. "student");
dataGrid Vicw1.DataSource ds. T'ables|"student"];
con.Close( ):
CH.Net
akshaypqwle@gmail.com 10
B.C.A. Third Year VI Semester
Windows Programming (BCA-604-A)
Theory Question Bank