Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
NAME
REGISTER NO.
ROLL NO.
YEAR
SEMESTER
LAB EXERCISES
PART A
VB.NET PROGRAMMING
1. Accept a character from console and check the case of the character.
2. Write a program to accept any character from keyboard and display whether it is
vowel or not.
3. Write a VB.Net program to accept a string and convert the case of the characters.
4. Develop a menu based VB.Net application to implement a text editor with cut, copy,
paste, save and close operations.
5. Write a program to implement a calculator with memory and recall operations.
6. Develop a form in VB.NET to pick a date from Calendar control and display the day,
month, and year details in separate text boxes.
7. Develop a VB.Net application to perform timer based quiz of 10 questions.
8. Develop a VB.Net application using the File and Directory controls to implement a
common dialog box.
9. Develop a database application to store the details of students using ADO.NET
10. Develop a database application using ADO.NET to insert, modify, update and delete
operations.
11. Develop a VB.Net application using Datagrid to display records.
12. Develop a VB.Net application using Datagrid to add, edit and modify records.
PART B
ASP.NET and XML PROGRAMMING
1. Create a simple ASP.NET page to Output Text with a form, two HTML text boxes,
an HTML button, and an HTML <span> element. Create an event procedure for the
button.
2. Create a web application in ASP.NET using three different controls to the ASP.NET
page for reserving rooms in hotel. The three controls are a button control, a label
control, and a drop-down list control.
3. Create a application for Accessing a SQL Database by Using ADO.NET by
connecting to the SQL Server database and call a stored procedure. You then display
the data in a Repeater control.
4. Develop a web application to read the details of the selected country stored in XML
database and display back to the user using Web controls
5. Develop a web application to read an XML document containing subject, mark
scored, year of passing into a Dataset
LAPC
Page 1
INDEX
Expt
No.
Date
Page Marks
Staff
No.
Signature
PART A
1
Vowel Checking
Case Conversion
10
Calculator
12
Calendar Application
15
Quiz Creation
17
21
23
10
26
11
30
12
32
PART B
1
36
39
42
45
47
Beyond Syllabus
1
2
LAPC
Page 2
Part-A
VB.Net Programming
LAPC
Page 3
Ex.No. : 1
AIM:
Create an application to accept a character from console and check the case of the character.
PROCEDURE:
1.
2.
3.
4.
5.
6.
PROGRAM:
Form_Load
Dim c As Char
Console.WriteLine("Enter the character")
c = Console.ReadLine
If Asc(c) > 64 And Asc(c) < 91 Then
Console.WriteLine("Upper case")
ElseIf Asc(c) > 96 And Asc(c) < 122 Then
Console.WriteLine("Lower case")
Else
Console.WriteLine("Other Character")
End If
SAMPLE OUTPUT:
LAPC
Page 4
RESULT:
Thus the program for check the case of the character was executed and the output was
verified.
LAPC
Page 5
VOWEL CHECKING
Ex.No. : 2
AIM:
Write a VB.Net program to accept any character from keyboard and display whether it is
vowel or not.
PROCEDURE:
1.
2.
3.
4.
5.
PROGRAM:
btnresult_Click
Dim c As Char
c = UCase(txtinput.Text)
If c = "A" Or c = "E" Or c = "I" Or c = "O" Or c = "U" Then
txtoutput.Text = "VOWEL"
Else
txtoutput.Text = "NOT VOWEL"
End If
btnclear_Click
txtinput.clear()
txtoutput.clear()
SAMPLE OUTPUT:
LAPC
Page 6
RESULT:
Thus the program for vowel checking was executed and the output was verified.
LAPC
Page 7
CASE CONVERSION
Ex.No. : 3
AIM:
Write a VB .NET program to accept a string and convert the case of the characters.
PROCEDURE:
Click StartProgramsMicrosoftVisualStudio 2005 MicrosoftVisualStudio 2005
Select File New Project Windows application.
Open the Windows application.
Place a label and text as enter the string.
Place two textboxes one is used to enter the string, other used to display the result.
Then place two buttons, one is used to display result and other used to clear the
textboxes.
7. Then write the code in click event of button1 and button2.
8. Run the application by F5 key or pressing debug button.
1.
2.
3.
4.
5.
6.
PROGRAM:
Button1_Click
Dim len, i As Integer
Dim s, c As String
s = txtinput.Text
len = s.Length
For i = 1 To len
c = Mid(s, i, 1)
If Asc(c) > 96 And Asc(c) < 123 Then
txtoutput.AppendText(UCase(c))
Else
txtoutput.AppendText(LCase(c))
End If
Next
Button2_Click
txtinput.Clear()
txtoutput.Clear()
SAMPLE OUTPUT:
LAPC
Page 8
RESULT:
Thus the program for case conversion was executed and the output was verified.
LAPC
Page 9
Ex.No. : 4
AIM:
Develop a menu based VB .NET application to implement a text editor with cut, copy, paste,
save and close operations.
PROCEDURE:
Click StartProgramsMicrosoftVisualStudio 2005 MicrosoftVisualStudio 2005
Select File New Project Windows application.
Open the Windows application.
Place the MenuStrip in the form from tool box.
Main menu is constructed with number of sub menus named as open, close, save, cut,
copy, paste, undo, redo, color, font etc.,
6. Drag and place a RichTextBox in the form.
7. Insert the source code for appropriate menu items and finally run the application.
PROGRAM:
Form_Load
Label1.Visible = False
txtsave.Visible = False
btnsave.Visible = False
1.
2.
3.
4.
5.
NewToolStripMenuItem_Click
RichTextBox1.Clear()
SaveToolStripMenuItem_Click
Label1.Visible = True
txtsave.Visible = True
btnsave.Visible = True
CloseToolStripMenuItem_Click
RichTextBox1.Clear()
CutToolStripMenuItem_Click
RichTextBox1.Cut()
CopyToolStripMenuItem_Click
RichTextBox1.Copy()
PasteToolStripMenuItem_Click
RichTextBox1.Paste()
ExitToolStripMenuItem1_Click
End
btnsave_Click
RichTextBox1.SaveFile(CStr(txtsave.Text))
Label1.Visible = False
txtsave.Visible = False
btnsave.Visible = False
LAPC
Page 10
RESULT:
Thus the VB.NET application for Text Editor Creation was executed and the output was
verified.
LAPC
Page 11
CALCULATOR
Ex.No. : 5
AIM:
Write a program to implement the calculator with memory and recall operations.
PROCEDURE:
1.
2.
3.
4.
5.
6.
7.
PROGRAM:
General
Dim a, m As Integer
Dim o As Char
btn0_Click
txtinput.AppendText("0")
btn1_Click
txtinput.AppendText("1")
btn2_Click
txtinput.AppendText("2")
btn3_Click
txtinput.AppendText("3")
btn4_Click
txtinput.AppendText("4")
btn5_Click
txtinput.AppendText("5")
btn6_Click
txtinput.AppendText("6")
btn7_Click
txtinput.AppendText("7")
btn8_Click
txtinput.AppendText("8")
btn9_Click
txtinput.AppendText("9")
btnadd_Click
a = Val(txtinput.Text)
o = "+"
txtinput.Clear()
LAPC
Page 12
LAPC
Page 13
RESULT:
Thus the above program for calculator was executed and the output was verified.
LAPC
Page 14
Ex.No. : 6
CALENDAR APPLICATION
AIM:
Develop a form in VB .NET to pick a date from calendar control and display the day, month,
year in separate textboxes.
PROCEDURE:
Click StartProgramsMicrosoftVisualStudio 2005 MicrosoftVisualStudio 2005
Select File New Project Windows application.
Open the windows application form.
Place a DateTimePicker to select the date.
Place four label and textboxes named as day, date, month, and year.
Edit the following code in form load event and value changed event of
Datetimepicker.
7. Run the application by pressing F5 key.
1.
2.
3.
4.
5.
6.
PROGRAM:
Form_Load, DateTimePicker1_ValueChanged
txtday.Text = DateTimePicker1.Value.DayOfWeek.ToString
txtdate.Text = DateTimePicker1.Value.Day
txtmonth.Text = DateTimePicker1.Value.Month
txtyear.Text = DateTimePicker1.Value.Year
btnclear_Click
txtday.Clear()
txtdate.Clear()
txtmonth.Clear()
txtyear.Clear()
SAMPLE OUTPUT:
LAPC
Page 15
RESULT:
Thus the above program for display date, month, and year was executed and output was
verified.
LAPC
Page 16
Ex.No. : 7
QUIZ CREATION
AIM:
Develop a VB .NET application to perform timer based quiz of 10 questions.
PROCEDURE:
Click StartProgramsMicrosoft Visual Studio 2005 Microsoft Visual Studio 2005
Select File New Project Windows application.
Open the windows application form.
Place a TextBox and named as txtquestion.
Place a GroupBox and enter text as Answer.
Within the GroupBox place three RadioButton
Place a Button named as Result.
Then place a Timer and set interval property of timer as 3000.
Insert the code in Form_Load, btnresult,Timer1_Tick and RadioButton_Checked Chenged
event.
10. Run the application by pressing F5 key.
1.
2.
3.
4.
5.
6.
7.
8.
9.
PROGRAM:
General:
Dim quest(9, 3), ans(9, 1) As String
Dim i As Integer = -1
Quiz_Creation_Load:
quest(0, 0) = "Which language does not support .NET?"
quest(0, 1) = "C++"
quest(0, 2) = "C#"
quest(0, 3) = "C"
quest(1, 0) = "Expansion of WSDL is"
quest(1, 1) = "Web Server Description Language"
quest(1, 2) = "Web Service Definition Language"
quest(1, 3) = "Web Service Description Language"
quest(2, 0) = "IIS stands for"
quest(2, 1) = "Internet Information Services"
quest(2, 2) = "Intermediate Information Services"
quest(2, 3) = "Internet Information Server"
quest(3, 0) = "Which one of the Heart of .NET Framework"
quest(3, 1) = "CLR"
quest(3, 2) = "CTS"
quest(3, 3) = "CLS"
quest(4, 0) = "Which tool are used to handle metadata"
quest(4, 1) = "Reflection Tool"
quest(4, 2) = "Manifest Tool"
quest(4, 3) = "All"
quest(5, 0) = "Which one is not a part of .NET Framework"
quest(5, 1) = "Visual Studio.NET"
quest(5, 2) = "Visual Basic .NET"
quest(5, 3) = "ASP.NET"
quest(6, 0) = "ASP Stands for"
LAPC
Page 17
Page 18
RadioButton1_CheckedChanged:
ans(i, 1) = RadioButton1.Text
RadioButton2_CheckedChanged
ans(i, 1) = RadioButton2.Text
RadioButton3_CheckedChanged
ans(i, 1) = RadioButton3.Text
SAMPLE OUTPUT
LAPC
Page 19
RESULT:
Thus the VB.NET application for Timer based Quiz was executed and output was verified.
LAPC
Page 20
Ex.No. : 8
AIM:
Develop a VB .NET application using the File and Directory controls to implement a
common dialog box.
PROCEDURE:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Click Start ProgramsMicrosoft Visual Studio 2005 Microsoft Visual Studio 2005
Select File New Project Windows application.
Open the Windows Application form.
Place FolderBrowserDialog and OpenFileDialog from ToolBox
Place a GroupBox and enter Text as Select the Option.
Within the GroupBox place two RadioButton and enter Text as Folder Open, File Open.
Place a Button named as OK.
Place two LabelBox and TextBox from the ToolBox.
Insert the code in click event of btnok.
Run the application by pressing F5 key.
PROGRAM:
btnok_Click
If RadioButton1.Checked = True Then
FolderBrowserDialog1.ShowDialog()
txtfolder.Text = FolderBrowserDialog1.SelectedPath
Else
OpenFileDialog1.ShowDialog()
txtfile.Text = OpenFileDialog1.FileName
End If
SAMPLE OUTPUT
LAPC
Page 21
RESULT:
Thus the VB.NET application was executed and output was verified.
LAPC
Page 22
Ex.No. : 9
AIM:
Develop a Database application to store the details of students using ADO.NET.
PROCEDURE:
1. Click Start Programs Microsoft SQL Server SQL Server Management Studio
Express.
2. Then creating database by right clicking the database folder.
3. Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
4. Select File New Project Windows application.
5. Open the Windows application form.
6. Design a form with three LabelBox,three TextBox and a Button.
7. Type the source code in the button event.
8. Run the application by pressing F5 key.
Query:
create database student
use student
create table stud(regno varchar(10), sname varchar(10), dept varchar(10));
Source Code:
Imports System.Data.SqlClient
General
Dim con As New SqlConnection
Dim com As New SqlCommand
Database_Creation_Load
con.ConnectionString = "server=sys19;initial catalog=student; uid=sa; pwd="
con.Open()
com.Connection = con
btnstore_Click
If txtregno.Text = "" Or txtname.Text = "" Or txtdept.Text = "" Then
MsgBox("Please Fill All the Details")
Exit Sub
End If
com.CommandText = "insert into stud values(' " & txtregno.Text & " ',' " & txtname.Text & " ',
' " & txtdept.Text & " ' ) "
com.ExecuteNonQuery()
MsgBox("1 Row inserted Successfully")
txtregno.Clear()
txtname.Clear()
txtdept.Clear()
LAPC
Page 23
SAMPLE OUTPUT:
LAPC
Page 24
RESULT:
Thus the Database application to store the details of students using ADO.NET was
created and executed successfully.
LAPC
Page 25
Ex.No. : 10
AIM:
Develop a Database application using ADO.NET to insert, modify, update and delete
operations.
PROCEDURE:
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
Query:
create database student
use student
create table stud(regno varchar(10), sname varchar(10), dept varchar(10));
Source Code:
Imports System.Data.SqlClient
General
Dim con As New SqlConnection
Dim com As New SqlCommand
Dim rd As SqlDataReader
Database_Updation_Load
con.ConnectionString = "initial catalog=student; user id=sa;pwd="
con.Open()
com.Connection = con
RadioButton1_CheckedChanged
txtregno.Clear()
txtname.Clear()
txtdept.Clear()
LAPC
Page 26
Page 27
btnclear_Click
txtregno.Clear()
txtname.Clear()
txtdept.Clear()
SAMPLE OUTPUT
Insertion
Deletion
Updation
LAPC
Page 28
RESULT:
Thus the Database application using ADO.NET to insert, modify, update and delete
operations was created and executed successfully.
LAPC
Page 29
Ex.No. : 11
AIM:
Develop a VB.NET application using Datagrid to display record.
PROCEDURE:
1. Create a table using SQL Server Query Analyzer name stud which the following
columns.
Column Name
Data Type
regno
varchar(50)
name
varchar(50)
dept
varchar(50)
2. Insert the values into the table by using following query.
insert into stud values('101','Sree','Computer')
insert into stud values('102','Poomi','Computer')
insert into stud values('103','Laya','Computer')
insert into stud values('104','Bharathi','Computer')
3. Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
4. Select File New Project Windows application.
5. Open the Windows application form.
6. Select Data Add New Data Source.
7. Choose DatabaseNextNew Connection.
8. Enter the Server name(Ex. Sys19].
9. Then select Use SQL Server Authentication from Log on the Server.
10. Type User name as sa
11. From the Connect to a Database, click Select or enter a database name.
12. Select corresponding Database. Then Click OkNext
13. Select the Checkbox TablesFinish.
14. Place the DataGridView from ToolBox.
15. Select Choose Data Source Add Project Data Source DatabaseNextNext
Table Finish.
16. Run the application by pressing F5 key.
SAMPLE OUTPUT
LAPC
Page 30
RESULT:
Thus the .VBNET application using Datagrid to display record was created and executed
successfully.
LAPC
Page 31
Ex.No. : 12
AIM:
Develop a VB.NET application using Datagrid to add, edit, and modify records.
PROCEDURE:
1. Create a table using SQL Server Query Analyzer name stud which the following
columns.
Column Name
Data Type
regno
varchar(50)
name
varchar(50)
dept
varchar(50)
2. Insert the values into the table by using following query.
insert into stud values('101','Sree','Computer')
insert into stud values('102','Poomi','Computer')
insert into stud values('103','Laya','Computer')
insert into stud values('104','Bharathi','Computer')
3. Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
4. Select File New Project Windows application.
5. Open the Windows application form.
6. Place a DataGridView and three Button in the form.
7. Make a Database connection using connection string.
8. By using SQL Adapter and Dataset to fill the records in the DataGridView.
9. Then perform insert, update and delete function in the DataGridView.
10. Run the application using F5 key.
Source Code:
Imports System.Data.SqlClient
General
Dim con As New SqlConnection
Dim com As New SqlCommand
Dim da As SqlDataAdapter
Dim ds As New DataSet
Database_Updation_Datagrid_Load
con.ConnectionString = "initial catalog=student; user id=sa;pwd="
con.Open()
com.Connection = con
da = New SqlDataAdapter("SELECT * FROM STUD", con)
da.Fill(ds, "STUD")
DataGridView1.DataSource = ds.Tables("STUD")
btninsert_Click
com.Connection = con
com.CommandText =" insert into stud values( ' " &DataGridView1.CurrentRow.Cells(0).Value & " '
, ' " & DataGridView1.CurrentRow.Cells(1).Value & " ' , ' "
&DataGridView1.CurrentRow.Cells(2).Value & " ' ) "
com.ExecuteNonQuery()
MsgBox("RECORD INSERTED")
LAPC
Page 32
Deletion
Updation
After Deletion
LAPC
Page 33
RESULT:
Thus the .VBNET application using Datagrid to add, edit, and modify records was executed
successfully.
LAPC
Page 34
Part-B
ASP.Net and XML Programming
LAPC
Page 35
Ex.No. : 1
AIM:
Create a simple ASP.NET page to Output Text with a Form, two HTML Text Boxes, an
HTML button, and an HTML <span> element. Create an event procedure for the button.
PROCEDURE:
1. Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
2. Select File New Web site ASP.NET Web Site.
3. Then the Default.aspx page will be open and select the source tab.
4. Write the html coding within a <form> tag to create two textboxes and a button using
<input> tag.
5. Using <span> tag message can be displayed.
6. Run the application using F5 key.
SOURCE CODE:
<%@
Page
Language="VB"
AutoEventWireup="false"
CodeFile="Website_Creation.aspx.vb" Inherits="Website_Creation" %>
<!DOCTYPE
html
PUBLIC
"-//W3C//DTD
XHTML
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1.0
Transitional//EN"
LAPC
Page 36
SAMPLE OUTPUT:
LAPC
Page 37
RESULT:
Thus the creation of simple ASP.NET page using HTML controls was created and output
was verified.
LAPC
Page 38
Ex.No. : 2
AIM:
Create a web application in ASP.NET using three different controls to the ASP.NET page for
reserving rooms in hotel. The Three controls are a button control, a label control and drop-down list
control.
PROCEDURE:
1.
2.
3.
4.
5.
6.
Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
Select File New Web site ASP.NET Web Site.
Then the Default.aspx page will be open and select the Design tab.
Construct form with Text box, DropDownList, Button and Label.
Then insert the code in the Source tab for appropriate click event.
Run the website application using F5 key.
Source Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat ="server" >
Sub page_load(ByVal s As Object, ByVal e As EventArgs) Handles Me.Load
If Not IsPostBack Then
Dim i As Integer
For i = 1 To 10
DropDownList1.Items.Add(i)
Next
End If
Label1.Visible = False
End Sub
Sub Reserve_Click(ByVal s As Object, ByVal e As EventArgs)
Label1.Visible = True
Label1.Text = "The Room Reserved for " & TextBox1.Text & " is " & DropDownList1.Text
DropDownList1.Items.Remove(DropDownList1.Text)
If DropDownList1.Items.Count = 0 Then
Button1.Enabled = False
Label1.Text = "Room not available"
End If
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
LAPC
Page 39
LAPC
Page 40
RESULT:
Thus the web application for Hotel Reservation using ASP.NET was created and executed
successfully.
LAPC
Page 41
Ex.No. : 3
AIM:
Create an application for Accessing a SQL Database by using ADO.NET by connecting to the
SQL Server database and call a stored procedure. You then display the data in a Repeater control.
PROCEDURE:
1. Click Start Programs Microsoft SQL Server 2005 SQL Server Management
Studio Access.
2. Create a new database.
3. Create a table and insert the values into the table.
4. Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
5. Select File New Web site ASP.NET Web Site.
6. Select View Server Explorer.
7. In Server Explorer select Data Connections and expand it.
8. Right click the Stored Procedure in the Data Connections tab and click Add New Stored
Procedure.
9. Type the query in the code editor window and run the code by select Project Run.
10. Then type the code in the Source tab.
11. Run the website application using F5 key.
Source Code:
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
<%@ Import Namespace="system.data.sqlclient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat ="server">
Dim con As New sqlconnection
Dim com As New SqlCommand("sp1", con)
Dim rd As SqlDataReader
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles
Me.Load
con.ConnectionString = "server=sys19; initial catalog=student1; uid=sa;pwd="
con.Open()
com.Connection = con
com.CommandType = Data.CommandType.StoredProcedure
rd = com.ExecuteReader
rp.DataSource = rd
rp.DataBind()
End Sub
</script>
LAPC
Page 42
SAMPLE OUTPUT:
LAPC
Page 43
RESULT:
Thus the program for creating the application with Stored Procedure and Repeater Control
was executed successfully.
LAPC
Page 44
Ex.No. : 4
AIM:
Develop a web application to read the details of the selected country stored in XML database
and display back to the user using Web controls.
PROCEDURE:
1.
2.
3.
4.
5.
6.
7.
Create an XML file using Notepad or other editor and save the file as country.xml.
Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
Select File New Web site ASP.NET Web Site.
Then the Default.aspx page will be open and select the Design tab.
Drag the GridView and XmlDataSource control from the ToolBox.
Type the code in the source tab.
Run the website application using F5 key.
Country.XML
<?xml version="1.0"?>
<country>
<coun countryname="India"> </coun>
<coun countryname="Japan"></coun>
<coun countryname="China"></coun>
</country>
Source code:
<%@ Page Language="VB"%>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>XML With ASP.NET</title>
</head>
<body>
<form id="form1" runat="server">
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns ="false" DataSourceID
="xmldatasource1">
<Columns >
<asp:BoundField DataField ="countryname" HeaderText ="CountryName" SortExpression
="CountryName" />
</Columns>
</asp:GridView>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile ="C:\Documents and
Settings\Acer\My Documents\Kanaga\country.xml" XPath ="country/coun">
</asp:XmlDataSource>
</form>
</body>
</html>
LAPC
Page 45
RESULT:
Thus web application for XML with ASP.NET was created and executed successfully.
LAPC
Page 46
Ex.No. : 5
AIM:
Develop a web application to read an XML document containing subject, mark scored, and
year of passing into a Dataset.
PROCEDURE:
1. Create an XML file using Notepad or other editor and save the file as Mark.xml.
2. Click Start Programs Microsoft Visual Studio 2005 Microsoft Visual Studio 2005
3. Select File New Web site ASP.NET Web Site.
4. Then the Default.aspx page will be open and select the Design tab.
5. Drag the GridView control into the form.
6. Type the code in the Source tab.
7. Run the website application using F5 key.
Mark.xml:
<?xml version=1.0?>
<students>
<student>
<name>Laya</name>
<subject>.NET Programming</subject>
<mark>100</mark>
<year>2013</year>
</student>
<student>
<name>Sree</name>
<subject>Web Programming</subject>
<mark>100</mark>
<year>2013</year>
</student>
<student>
<name>Govi</name>
<subject>RDBMS</subject>
<mark>100</mark>
<year>2013</year>
</student>
<student>
<name>Mancy</name>
<subject>Advanced Computing</subject>
<mark>100</mark>
<year>2013</year>
</student>
</students>
LAPC
Page 47
Source Code:
<%@ Page Language="VB" %>
<%@ Import Namespace ="system.data" %>
<script runat ="server" >
Protected Sub page_load()
Dim data As New DataSet
data.ReadXml(MapPath("Mark.xml"))
GridView1.DataSource = data
GridView1.DataBind()
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>XML With DataSet</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
SAMPLE OUTPUT:
LAPC
Page 48
RESULT:
Thus web application for XML with Dataset was created and executed successfully.
LAPC
Page 49
Beyond Syllabus
LAPC
Page 50
LAPC
Page 51
LAPC
Page 52
LAPC
Page 53
LAPC
Page 54
LAPC
Page 55