Escolar Documentos
Profissional Documentos
Cultura Documentos
Date: 14/10/2013
Table of Contents
Page no.
1. Course details
1.1. Course objective (s)
03
1.2. Pre-requisites
03
03
04
2. List of Experiments
06
08
35
COURSE DETAILS
Course Objective(s)
Students will gain the ability to implement the algorithms in C#.net, VB.net and ASP.net.
Pre-requisite
1. Programming experience of .NET Technologies (BCA-303)
9 lecture hours
Introducing C#, Understanding .NET, Overview of C#, Literals, Variables, Data Types, Operators,
Expressions, Branching, Looping, Methods, Arrays, Strings, Structures, Enumerations, Classes,
Objects, Inheritance, Polymorphism, Interfaces, Operator Overloading, Delegates, Events, Errors
3
and Exceptions, Defining classes and class members. Assembly, Components of Assembly, Private
and Shared Assembly, Garbage Collector, JIT compiler. Namespaces Collections, Comparisons
and Conversions, Delegates and Events.
Unit II:C#
7 lecture hours
Getting Started with .Net Framework, Exploring Visual Studio .NET, Inside a C# Program, Data
Types, Statements, Arrays, Using Strings, Objects, Classes and Structs, Properties, Inheritance,
Indexers, Delegates, Events, Namespaces, Generics, Collections and Data Structures, Exception
Handling, Threading, Using Streams and Files, Reflection, Assemblies, versioning, Windows
Forms, Controls, Data binding to Conrols, Advanced Database Programming using ADO.net,
Using GDI +,Networking,.net Remoting, Manipulating XML.
Unit III: VB.Net
8 lecture hours
Creating Applications with Visual Basic.NET, Variables, Constants, and Calculations, Making
Decisions and Working with Strings, Lists, Loops, Validation, Sub Procedures and Functions,
Multiple Forms, Standard Modules, and Menus, Arrays, Timers, Form Controls, File Handling,
Exception Handling, Working with Databases, Advanced Database Programming using ADO.net,
Classes, Generics, Collections, Inheritance, Custom Controls, Packaging & deployment, Using
Crystal Reports.
Unit IV: ASP.NET
9 lecture hours
Building a Web Application, Examples Using Standard Controls, Using HTML Controls,
Validating Form Input Controls using Validation Controls, Understanding Applications and State,
Applying Styles, Themes, and Skins, Creating a Layout Using Master Pages, Binding to Databases
using Controls, Data Management with ADO.net, Creating a Site Navigation Hierarchy,
Navigation Controls , Membership and Role Management, Login Controls, Securing Applications,
Caching For Performance, Working with XML, Using Crystal Reports in Web Forms.
Unit V: DBMS
8 lecture hours
Databases: Introduction, Using SQL to work with database, retrieving and manipulating data with
SQL, working with ADO.NET, ADO.NET architecture, ASP.NET data control, data source
control, deploying the web site. Crystal reports. LINQ: Operators, implementations, LINQ to
objects, XML, ADO.NET, Query Syntax.
Reference Books
1. Visual studio 2010 - A beginners guide - Joseph Mayo
3. Jeffrey R. Shapiro The Complete Reference Visual Basic .NET Tata Mcgraw Hill (2002
Edition).
4. Pro ASP.NET 4 in C# 2010, MacDonald and Freeman
5. Visual Studio 2010 and .NET 4 Six-in-One (Wrox Programmer to Programmer)
Internal
50
Laboratory
SEE
50
100
Theory and
laboratory
SEE
50
100
100
Internal
50
75
25
Relationship between the Course Outcomes (COs) and Program Outcomes (POs)
Mapping between Cos and Pos
Course Outcomes (COs)
Sl. No.
Mapped
Program
Outcomes
1
1,3
CSE303
.NET
Technologies
Life-long Learning
Project management
and finance
Communication
Design/development
of solutions
Course Name
Individual or team
work
Problem analysis
Course
Code
Program
Outcome
3,5,9,11
Ethics
Engineering
Knowledge
3,5,9
Environment and
sustainability
Query textbox and Displaying records & Display records by using database
Datalist link control & Databinding using dropdownlist control
Inserting record into a database & Deleting record into a database
Databinding using datalist control & Datalist control templates
Databinding using datagrid & Datagrid control template
Datagrid hyperlink & Datagrid button column
Datalist event & Datagrid paging
Creating own table format using datagrid
Conduct
investigations of
complex problems
1
2
10
11
12
3
2
LIST OF EXPERIMENTS
Topic
Sr No.
2
3
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
EXPERIMENT DETAILS
Experiment No:1(a)
Title
Objective
Algorithm
Sample output
Experiment No:1(b)
Title
Objective
Algorithm
Sample output
Experiment No:1(c)
Title
Objective
Algorithm
Partial
Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e
As
System.EventArgs) Handles Button1.Click
Dim a As Double
Dim b As Double
Dim c As Double
Dim s As Double
Dim x1 As Double
Dim x2 As Double
a = TextBox1.Text
b = TextBox2.Text
c = TextBox3.Text
s = Math.Sqrt(b *b - 4 * a * c)
If (b * b - 4 * a * c) = 0 Then
Label5.Text = "Roots are Equal"
x1 = (-b + s) / 2 * a
x2 = (-b - s) / 2 * a
Label6.Text ="The Roots : " & x1
ElseIf (b * b - 4* a * c) < 0 Then
Label5.Text ="The Roots are Imaginary"
Else Label5.Text ="The Roots are Not Equal"
x1 = (-b + s) / 2 * a
x2 = (-b - s) / 2 * a
10
Experiment No:1(d)
Title
Objective
Algorithm
11
Sample output
Experiment No:1(e)
Title
Objective
Algorithm
12
Sub
Application_End(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Sub
Application_Error(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Sub
Session_Start(ByVal sender As Object, ByVal e As EventArgs)
End Sub
Sub Session_End(ByVal sender As Object, ByVal e As EventArgs)
End Sub
</script>
Sample output
After enter the wrong password
Experiment No:2
Title
Objective
Algortihm
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Application("visits") = Int(Application("visits") + 1)
Label6.Text = Application("visits")
Label8.Text = Session("My text").ToString
End Sub
13
Sample
output
14
Experiment No:3
Title
Objective
Algortihm
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
<Ad>
<ImageUrl>.\image\p1.jpg</ImageUrl>
<NavigateUrl>www.pepsi.com</NavigateUrl>
<AlternativeText>Pepsi</AlternativeText>
<Keyword>softdrink</Keyword> <Impression>2</Impression>
</Ad> <Ad>
<ImageUrl>.\image\p2.jpg</ImageUrl> <NavigateUrl>www.Excel.com</NavigateUrl>
<AlternativeText>Excel</AlternativeText> <Keyword>softdrink</Keyword>
<Impression>2</Impression>
</Ad> <Ad>
<ImageUrl>.\image\p3.jpg</ImageUrl> <NavigateUrl>www.7up.com</NavigateUrl>
<AlternativeText>7up</AlternativeText> <Keyword>softdrink</Keyword>
<Impression>2</Impression>
</Ad> <Ad>
<ImageUrl>.\image\p4.jpg</ImageUrl> <NavigateUrl>www.Mirinda.com</NavigateUrl>
<AlternativeText>Mirinda</AlternativeText> <Keyword>softdrink</Keyword>
<Impression>2</Impression>
</Ad>
</Advertisements>
Sample
output
VIEW 1
VIEW 2
15
Experiment No:4(a)
Title
Objective
Algortihm
Sample
output
16
Experiment No:4(b)
Title
Objective
Algortihm
Sample
output
17
Experiment No:4(c)
Title
Objective
Algortihm
18
Sample
output
Experiment No:4(d)
Title
Write a Program to display the Difference between the two dates in the
calendar.
Objective
Algortihm
Imports system.data.sqlclient
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
If floor(Calendar2.SelectedDate > Calendar1.SelectedDate)
Then
Dim a As double = Math.abs(Calendar2.SelectedDate - Calendar1.SelectedDate).TotalDays
Dim y As Double = a / 365 Label1.Text = floor(y) & "YEARS" Dim x As Double= a mode 365
Dim m As Integer = x / 31 Label2.Text =floor(m) & "MONTHS"
Dim d As Integer = x mode 31
Label3.Text = floor(d) & "DAYS"
Else
MsgBox("Invalid date")
End If
End Sub
End Class
19
Sample
output
Experiment No:5(a)
Title
Objective
Algortihm
Sample
output
20
Experiment No:5(b)
Title
Objective
Algortihm
Sample
output
Experiment No:6
Title
Objective
Algortihm
21
Sample
output
Experiment No:7
Title
Objective
Algortihm
22
Sample
output
Experiment No:8
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim conpubs As SqlConnection
Dim strselect As String
Dim cmdselect As SqlCommand
conpubs =
New SqlConnection(constr)
23
strselect
cmdselect
= New SqlCommand(strselect,
conpubs)
cmdselect.Parameters.Add("@Au_fname",
Au_fname.Text)
cmdselect.Parameters.Add("@Au_lname",
Au_lname.Text)
conpubs.Open()
label5.Text = cmdselect.ExecuteScalar() conpubs.Close()
End Sub
End Class
Sample
output
Experiment No:9
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
If Not IsPostBack Then
BindDataList()
End If
End Sub
24
Sub BindDatalist()
Dim conpubs As SqlConnection Dim cmdselect As SqlCommand Dim dtrAuthor As
SqlDataReader
conpubs = New SqlConnection(constr) conpubs.Open()
cmdselect = New SqlCommand("Select * from Author", conpubs) dtrAuthor =
cmdselect.ExecuteReader() dtrlstAuthor.DataSource = dtrAuthor
dtrlstAuthor.DataBind()
dtrAuthor.Close()
conpubs.Close()
End Sub
Protected Sub dtrlstAuthor_ItemCommand(ByVal source As Object, ByVal e As
System.Web.UI.WebControls.DataListCommandEventArgs) Handles
dtrlstAuthor.ItemCommand
dtrlstAuthor.SelectedIndex = e.Item.ItemIndex
BindDatalist()
End Sub
End Class
Sample
output
Experiment No:10
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Label1.Text = "you pick" & DropDownList1.SelectedValue
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
If Not IsPostBack Then
Dim conpubs As SqlConnection
Dim cmdselect As SqlCommand
Dim dtrAuthor As SqlDataReader
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("select Au_fname from Author", conpubs)
conpubs.Open()
dtrAuthor = cmdselect.ExecuteReader()
DropDownList1.DataSource = dtrAuthor
DropDownList1.DataTextField = "Au_fname"
25
DropDownList1.DataBind()
dtrAuthor.Close()
conpubs.Close()
End If
End Sub
End Class
Sample
output
Experiment No:11
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim conpubs As SqlConnection Dim strInsert As String
Dim cmdInsert As SqlCommand
conpubs = New SqlConnection(constr)
strInsert = "Insert Author(Au_fname,Au_lname)values(@Au_fname,@Au_lname)"
cmdInsert = New SqlCommand(strInsert, conpubs) cmdInsert.Parameters.Add("@Au_fname",
txtfname.Text) cmdInsert.Parameters.Add("@Au_lname", txtlname.Text) conpubs.Open()
cmdInsert.ExecuteNonQuery()
conpubs.Close()
Response.Write(New Rowinserted) End Sub
End Class
Sample
output
26
Experiment No:12
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("RajeevConnectionString1").ConnectionSt ring
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Handles Button1.Click
Dim conpubs As SqlConnection Dim strdelete As String
Dim cmddelete As SqlCommand
conpubs = New SqlConnection(constr)
strdelete = "delete from Author where Au_fname=@Au_fname" cmddelete = New
SqlCommand(strdelete, conpubs) cmddelete.Parameters.Add("@Au_fname", TextBox1.Text)
conpubs.Open()
cmddelete.ExecuteNonQuery() Response.Write("Row delete") conpubs.Close()
End Sub
End Class
Sample
output
Experiment No:13
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Dim conpubs As SqlConnection Dim cmdselect As SqlCommand Dim dtrAuthor As
27
SqlDataReader
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("Select Au_fname from Author", conpubs) conpubs.Open()
dtrAuthor = cmdselect.ExecuteReader() dlstAuthor.DataSource = dtrAuthor
dlstAuthor.DataBind() dtrAuthor.Close()
conpubs.Close() End Sub
End Class
Sample
output
Experiment No:14
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Dim conpubs As SqlConnection Dim cmdselect As SqlCommand Dim dtrAuthor As
SqlDataReader
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("Select * from Author", conpubs) conpubs.Open()
dtrAuthor = cmdselect.ExecuteReader() dtrlstAuthor.DataSource = dtrAuthor
dtrlstAuthor.DataBind() dtrAuthor.Close()
conpubs.Close() End Sub
End Class
Sample
output
28
Experiment No:15
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("RajeevConnectionString1").ConnectionSt ring
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Dim conpubs As SqlConnection
Dim cmdselect As SqlCommand
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("select * from Author", conpubs)
conpubs.Open()
datagrd.DataSource = cmdselect.ExecuteReader()
datagrd.DataBind()
conpubs.Close()
End Sub
Protected Sub datagrd_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles datagrd.SelectedIndexChanged
End Sub
End Class
Sample
output
Experiment No:16
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DAtabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Dim conpubs As SqlConnection Dim cmdselect As SqlCommand
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("select * from Author", conpubs) conpubs.Open()
datagrd.DataSource = cmdselect.ExecuteReader() datagrd.DataBind()
29
conpubs.Close()
End Sub
End Class
Sample
output
Experiment No:17
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
Dim conpubs As SqlConnection
Dim cmdselect As SqlCommand
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("select * from Author", conpubs)
conpubs.Open()
datagrdlnk.DataSource = cmdselect.ExecuteReader()
datagrdlnk.DataBind()
conpubs.Close()
End Sub
End Class
Sample
output
30
Experiment No:18
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
If Not IsPostBack Then
Dim conpubs As SqlConnection Dim cmdselect As SqlCommand
conpubs = New SqlConnection(constr)
cmdselect = New SqlCommand("select * from Author", conpubs) conpubs.Open()
GridView1.DataSource = cmdselect.ExecuteReader() GridView1.DataBind()
conpubs.Close() End If
End Sub
Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewCommandEventArgs) Handles
GridView1.RowCommand
If e.CommandName = "select" Then GridView1.SelectedRowStyle.BackColor =
Drawing.Color.Green
Else
GridView1.SelectedRowStyle.BackColor = Drawing.Color.White
End If
End Sub
End Class
Sample
output
Experiment No:19
Title
Objective
Algortihm
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("RajeevConnectionString1").ConnectionSt ring
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
If Not IsPostBack Then
Dim conpubs As SqlConnection
Dim cmdselect As SqlCommand
31
Sample
output
32
Experiment No:20
Title
Objective
Algortihm
Imports System.Data
Imports System.Data.SqlClient
Partial Class _Default
Inherits System.Web.UI.Page
Dim constr As String =
ConfigurationManager.ConnectionStrings("DatabaseConnectionString1").Connection String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
If Not IsPostBack Then
Binddatagrid()
End If
End Sub
Sub Binddatagrid()
Dim conpubs As SqlConnection Dim dtrtitle As SqlDataAdapter Dim datset As DataSet
conpubs = New SqlConnection(constr)
dtrtitle = New SqlDataAdapter("select * from Author", conpubs) datset = New DataSet
dtrtitle.Fill(datset) GridView1.DataSource = datset GridView1.DataBind()
End Sub
Protected Sub GridView1_PageIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GridView1.PageIndexChanged
End Sub
Protected Sub GridView1_PageIndexChanging(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewPageEventArgs) Handles
GridView1.PageIndexChanging
GridView1.PageIndex = e.NewPageIndex
Binddatagrid()
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles GridView1.SelectedIndexChanged
End Sub
End Class
Sample
output
33
Experiment No:21
Title
Write a Program create an own table and bind data using data grid.
Objective
Algortihm
Imports System.Data
Partial Class _Default
Inherits System.Web.UI.Page
Function CreateDatasource() As ICollection
Dim dt As New DataTable()
Dim dr As DataRow
dt.Columns.Add(New DataColumn("integervalue", GetType(Int32))) dt.Columns.Add(New
DataColumn("stringvalue", GetType(String)))
dt.Columns.Add(New DataColumn("currencyvalue", GetType(Double)))
Dim i As Integer
For i = 0 To 8
dr = dt.NewRow() dr(0) = i
dr(1) = "item" + i.ToString dr(2) = 1.23 * (i + 1) dt.Rows.Add(dr)
Next i
Dim dv As New DataView(dt) Return dv
End Function
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
If Not IsPostBack Then
GridView1.DataSource = CreateDatasource()
GridView1.DataBind()
End If
End Sub
End Class
Sample
output
34
S No.
Name
Enroll No.
Viva/File(5)
Viva/File(5)
Viva/File(5)
Viva/File(5)
Viva/File(5)
10
11
12
13
14
15
35
16
17
18
19
20
21
22
23
24
25
Enroll no.
Name
Lab file
(10)
Attendance
(10)
Quiz
(10)
Viva
(10)
Program with
execution(10)
Total
(50)
36