Professional Documents
Culture Documents
Dot Net PDF
Dot Net PDF
2. Write a program to accept any character from keyboard and display whether it is vowel
or not.
3. Wrtie 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, year details in seperate text boxes.
8. Develop a VB.Net application using the File, Direcory and Directory controls to
implement a common dialog box.
12 Develop a VB.Net application using Datagrid to add, edit and modify records.
ASP.NET
13. 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.
14.. Create a web controls to a page with 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.
15. 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.
16. Create a web services application for calling a Web service for a hotel named full. And
you will call another Web service for a hotel named Empty, and then retrieve
information regarding room availability. The Web service for the Full hotel is named
Hotel_Full.dll. The Web service for the Empty hotel is named Hotel_Empty.dll. There
are five methods in each service.
1. Reserve takes room types and start and end dates and returns a Boolean
value that indicates whether a room is available.
<WebMethod()>public Function Reserve (
2. Price returns a double value that is the cost of the rent for one day
<WebMethod()>public Function Price(
5. Food returns a string that describes the food available at the hotel.
<WebMethod()>public Function Food() As String.
Software Required: (1) Net Frame Work (ii) . VB,NET (iii) ASP.NET
AIM
PROGRAM
2.View the Solution explorer. Right click on the project name And select
Properties
Module Module1
Dim c As Char
Sub Main()
Console.WriteLine("Enter a character : ")
c = Console.ReadLine
If Char.IsUpper(c) Then
Console.WriteLine("Given Character is in Uppercase")
Else
Console.WriteLine("Given Character is not an alphabet")
End If
Console.ReadLine()
End Sub
End Module
SAMPLE OUTPUT
Enter a character : g
RESULT
AIM
Write a VB.NET program to accept any character from keyboard and
display whether it is vowel or not.
PROCEDURE
Module Module1
Dim c As Char
Sub Main()
C=Console.ReadLine
Else
End If
Console.ReadLine()
End Sub
End Module
SAMPLE OUTPUT
Enter a character : a
RESULT
AIM
Write a VB.Net program to accept a string and convert the
Case of the character.
PROCEDURE
TextBox2.Text = LCase(TextBox1.Text)
End Sub
TextBox2.Text = UCase(TextBox1.Text)
End Sub
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
End
End Sub
End Class
PROPERTY WINDOW
Properties
Controls
Name Text
RESULT
AIM
Develop a menu based VB.NET application to implement a text editor
With cut, copy, paste, saved and close operations.
PROCEDURE
1..Open Microsoft Visual studio and create a new Window
Application
2.Design a form
3.Edit the code in the event of all controls
4.Run the application
PROGRAM
RTB.Clear()
End Sub
Label1.Visible = False
TextBox1.Visible = False
ButSave.Visible = False
End Sub
Label1.Visible = True
TextBox1.Visible = True
ButSave.Visible = True
End Sub
RTB.SaveFile(CStr(TextBox1.Text))
Label1.Visible = False
TextBox1.Visible = False
ButSave.Visible = False
End Sub
RTB.Clear()
End Sub
RTB.Cut()
End Sub
RTB.Copy()
End Sub
RTB.Paste()
End Sub
End
End Sub
End Class
PROPERTY WINDOW
Properties
Controls
Name Text
MnuNew New
MnuSave Save
MnuClose Close
MnuCut Cut
MnuCopy Copy
MnuExit Exit
RichTextBox RTB
RESULT:
AIM
Write a program in VB.Net to implement a calculator with memory and
recall operation
PROCEDURE
Dim a, m As Integer
Dim op As Char
Text1.Clear()
End Sub
m = Text1.Text
Text1.Clear()
End Sub
Text1.Text = m
End Sub
Text1.AppendText("1")
End Sub
tAText1.AppendText("2")
End Sub
Private Sub ButThree_Click(ByVal sender As System.Object, ByVal e As
Text1.AppendText("3")
End Sub
Text1.AppendText("4")
End Sub
Text1.AppendText("5")
End Sub
Text1.AppendText("6")
End Sub
Text1.AppendText("7")
End Sub
Text1.AppendText("8")
End Sub
End Sub
Text1.AppendText("0")
End Sub
a = Val(Text1.Text)
op = "+"
Text1.Clear()
End Sub
a = Val(Text1.Text)
op = "-"
Text1.Clear()
End Sub
a = Val(Text1.Text)
op = "*"
Text1.Clear()
End Sub
op = "/"
Text1.Clear()
End Sub
Select Case op
End Select
End Sub
a = Val(Text1.Text)
op = "%"
Text1.Clear()
End Sub
End Class
PROPERTY WINDOW
Properties
Controls
Name Text
Button ButOne 1
Button ButTwo 2
Button ButThree 3
Button ButFour 4
Button ButFive 5
Button ButSix 6
Button ButSeven 7
Button ButEight 8
Button ButNine 9
Button ButZero 0
Button ButMem M
Button ButCancel C
Button ButRecall R
Button ButPlus +
Button ButMinus -
Button ButMul *
Button ButDiv /
Button ButEqual =
Button ButPer %
RESULT:
Thus the above program has been executed and verified.
EX.NO:6 Display Day, Month, Year from Calendar Control
AIM
Develop a form in VB.NET to pick a date form calender
control and display the Day,month,year in separate text boxes.
PROCEDURE
TextBox3.Text = DateTimePicker1.Value.Year
TextBox1.Text = DateTimePicker1.Value.Day
TextBox2.Text = DateTimePicker1.Value.Month
TextBox3.Text = DateTimePicker1.Value.Year
End Sub
End
End Sub
End Class
PROPERTY WINDOW
Properties
Controls
Name Text
Label Label1 Display Day, Month and Yea of The Given Dater
DateTimePicker DateTimePicker1
AIM
To Develop a VB.NET application to perform timer based
quiz of 5 questions.
PROCEDURE
2. Design a Form
3. Edit the code in the event of all controls
Dim i As Integer = -1
handles MyBase.Load
quest(0, 0) = "In which year india won the cricket world cup?"
quest(0, 1) = "1973"
quest(0, 2) = "1983"
quest(0, 3) = "1986"
quest(1, 1) = "Input"
quest(1, 2) = "Output"
quest(1, 3) = "i/o"
quest(2, 2) = "Java"
quest(3, 1) = "Thomas"
quest(3, 2) = "Andrew"
quest(3, 3) = "Philip"
quest(4, 1) = "24-12-2006"
quest(4, 2) = "26-12-2004"
quest(4, 3) = "26-12-2006"
ans(0, 0) = "1983"
ans(1, 0) = "Input"
ans(3, 0) = "Thomas"
ans(4, 0) = "26-12-2004"
Timer1.Enabled = True
Button1.Enabled = False
End Sub
Handles Timer1.Tick
i=i+1
If (i = 5) Then
Timer1.Enabled = False
Button1.Enabled = True
Else
RadioButton1.Checked = False
RadioButton2.Checked = False
RadioButton3.Checked = False
TextBox1.Text = quest(i, 0)
RadioButton1.Text = quest(i, 1)
RadioButton2.Text = quest(i, 2)
RadioButton3.Text = quest(i, 3)
End If
End Sub
End Sub
ans(i, 1) = RadioButton2.Text
End Sub
ans(i, 1) = RadioButton3.Text
End Sub
Dim j As Integer
For j = 0 To 4
count += 1
End If
Next
End Sub
End
End Sub
End Class
PROPERTY WINDOW
Properties
Controls
Name Text Interval
RESULT;
AIM
Develop a VB.NET application using the File and directory
controls to implement a common dialog box.
PROCEDURE
2. Design a Form
FolderBrowserDialog 1.ShownDialog()
TextBox1.Text = FolderBrowserDialog1.SelectedPath
Else
OpenFileDialog1.ShownDialog()
TextBox2.Text = OpenFileDialog1.FileName
End If
If RadioButton1.Checked Then
FolderBrowserDialog1.ShowDialog()
TextBox1.Text = FolderBrowserDialog1.SelectedPath
Else
OpenFileDialog1.ShowDialog()
TextBox2.Text = OpenFileDialog1.FileName
End If
End Sub
End Class
PROPERTY WINDOW
Properties
Controls
Name Text
Button ButOk Ok
RESULT:
AIM
To Develop a database application to details of students
using ADO.NET.
PROCEDURE
Use student
dept varchar(10))
4. Edit the following line at the top of the coding before any other code
Imports System.Data.SqlClient
5 . Edit tje following code inside the class Form1 before all the sub funtions.
con.Open()
con.Connection = con
7. Edit the following code in the Click event of the Button1
Exit Sub
End If
TextBox1.Text &
com.ExecuteNonQuery()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
Imports System.Data.Odbc
Handles ButStore.Click
Exit Sub
End If
com.CommandText = "insert into tam_db1 values('" & TextBox1.Text & "','" &
com.ExecuteNonQuery()
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
End Sub
Handles MyBase.Load
con.Open()
com.Connection = con
End Sub
End
End Sub
End Class
Properties
Controls
Name Text
RESULT:
OPERATIONS
AIM
PROCEDURE:
Use student
4. Edit the following line at the top of the coding before any other code
Imports System.Data..SqlClient
5. Edit the following code inside the class form1 before all the sub functions
Dim rd As SqlDataReader
con.Open()
com.connection = con
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
ComboBox1.Visible = False
Button1.Enabled = True
Button2.Enabled = False
Button3.Enabled = False
ComboBox1.Items.Clear()
Button1.Enabled = False
Button2.Enabled = True
Button3.Enabled = True
ComboBox1.Visible = True
rd = com.ExecuteReader
While rd.Read
ComboBox1.Items.Add(rd.GetString(0))
End While
rd.Close()
rd = com.ExecuteReader
If rd.Read Then
TextBox2.Text = rd.GetString(1)
TextBox3.Text = rd.GetString(2)
End If
rd.Close()
10. Edit the following code in the Click event of the Button1
Exit Sub
End If
com.ExecuteNonQurey()
11. Edit the following code in the Click event of the Button2
com.ExecuteNonQurey()
ComboBox1.Items.Remove(ComboBox1.SelectedItem)
TextBox2.Clear()
TextBox3.Clear()
MsgBox("Record deleted")
12. Edit the following code in the Click event of the Button3
TextBox2.Text &
"',dept='" & TextBox3.Text &"' where regno='" &
ComboBox1.SelectedItem &"'"
com.ExecuteNonQurey()
MsgBox("Record updated")
Imports System.Data.Odbc
Dim rd As OdbcDataReader
con.Open()
com.Connection = con
End Sub
Exit Sub
TextBox1.Clear()End If
com.CommandText = "insert into tam_db1 values (' " & TextBox1.Text &
" ',' " & TextBox2.Text & " ',' " & TextBox3.Text & " ') "
com.ExecuteNonQuery()
MsgBox("1 Record is inserted")
End Sub
com.ExecuteNonQuery()
ComboRollNo.Items.Remove(ComboRollNo.SelectedItem)
TextBox1.Clear()
TextBox3.Clear()
MsgBox("Record is deleted")
End Sub
rd = com.ExecuteReader
If rd.Read Then
TextBox1.Text = rd.GetString(0)
TextBox3.Text = rd.GetString(2)
End If
rd.Close()
End Sub
TextBox2.Clear()
TextBox3.Clear()
ComboRollNo.Visible = False
ButInsert.Enabled = True
ButDelete.Enabled = False
ButUpdate.Enabled = False
End Sub
ComboRollNo.Items.Clear()
ButInsert.Enabled = False
ButDelete.Enabled = True
ButUpdate.Enabled = True
ComboRollNo.Visible = True
rd = com.ExecuteReader
While rd.Read
ComboRollNo.Items.Add(rd.GetString(1))
End While
rd.Close()
End Sub
End Classcom.CommandText = "Update tam_db1 set name='" & TextBox1.Text & "',dept='" &
com.ExecuteNonQuery()
MsgBox("Record is updated")
End Sub
Handles ButClose.Click
End
End Sub
Properties
Controls
Name Text
AIM
PROCEDURE
3. Click ADD? SQL server?Finish.Enter a name for the DSN and enter the name
of the server and click Next.
4. Click the radiobutton With SQL server authentication.enter the Loginid and
password and click Next.
6. Close the ODBC window and Open Microsoft Visual studio and
create a new Windows application
7. Drag the DataGrid controll from the ToolBox into the from 1.
(if the datagrid control not exist then right
click on any data control,select choose items....option.
Tick the datagrid controls.
9. Change the data source into Mircosoft ODBC Data source and select the Data source name.
Enter the username and password and click test connection OK, OK,OK, Next
11. In the Data menu select Show Data Soucres option Drag the
table name into DataGrid control.
Handles MyBase.Load
'TODO: This line of code loads data into the 'MasterDataSet.student' table. You can move, or
remove it, as needed.
Me.StudentTableAdapter.Fill(Me.MasterDataSet.student)
End Sub
End Class
RESULT:
AIM
PROGRAM:
</script>
<html xmlns ="http://www.w3.org /1999/xhtml">
<head runat="server">
<title> Untitled Page</title>
</head>
<body>
<from runat="server">
<span>
Username:
<input id="Text 1"type="text runat="server"/></br/>
Password:
<input id ="password 1"type="password"runat="server"
style="width:149px" />
AIM
PROCEDURE:
Inherits="_Default" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
Dim i As Integer
For i = 1 To 10
DropDownList1.Items.Add(i)
Next
End If
End Sub
If DropDownList1.Items.Count=0 Then
Button1.Enabled=False
End If
End Sub
</script>
<head runat="server">
</head>
<body>
<form id="form1" runat="server">
<div>
<br /> </strong> </span> <br /> <br /> <br />
Font-Size="12pt"></asp:Label>
</html>
RESULT:
AIM
PROCDURE
CodeFile =Default3.aspx.vbInherits=Defult3%>
Transitional..//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-
Transitional.dtd>
<script runat=server>
Handles Me.Load
Conn.ConnectionString=initial catalog=MGPT;user
Id=sa;pwd=
Conn.Open()
Comm.Connection = Conn
DropDownList1.DataSource = Comm.ExecuteReader
DropDownList1.DataTextfield= LType
DropDwonList1.DataBind()
End If
End Sub
LType=@Type
Comm.Parameters.AddWidthValue(@Type,
DropDownList1.Text)
Repeater1.DataSource=Comm.ExecuteReader
Repeater1.DataBind()
End Sub
</script>
</html xmlns=http://www.w3.org/1999/Xhtml>
<head runat=server>
</title>Untitled Page</title>
</head>
<body>
<from id =from1runat=server>
<div>
Staff Type : <asp:DropDownList
ID=DropDownList1runat=server
Width=173px>
</asp:DropDownList>&nsbp;<asp:Button ID=Button1
Runat =serverText=ShowOnClick=Show_Click/>
<br/><br/>
<asp:Repeater ID=Repeater1runat=server>
<HeaderTemplate>
<front color=maroon>
<h2>Names</h2>
</front>
</HeaderTemplate>
<ItemTemplate>
<front color=aquaface=Arial>
<%#Container.DataItem(LName)%>
</front>
</ItemTemplate>
<SeparatorTemplate>
</asp:Repeater>
</div>
</from>
</body>
</html>
RESULT: