The document describes implementing a Windows Forms application in C# using various controls like menus, dialog boxes, and tooltips. It includes code for handling events like loading the form, clicking menu items like File and Edit, and clicking items on a toolbar. The application demonstrates using common controls and handling events in a Windows Forms application.
1. 090360116058 Dot Net Technology
PRACTICAL NO: 1
AIM: Write a program for Arithmetic Calculator using Console &
Windows Application in C# & VB.NET.
Console Calculator.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSConsoleApplicationCalculator
{
class Program
{
static void Main(string[] args)
{
int a, b, n;
Console.WriteLine("Calculator in C# Console Application ");
Console.WriteLine("enter the value of A");
a = int.Parse(Console.ReadLine());
Console.WriteLine("enter the value of B");
b = int.Parse(Console.ReadLine());
Console.WriteLine("enter choice n 1 = Addition n 2 = Substraction n 3 =
Multiplication n 4 = Division");
n = int.Parse(Console.ReadLine());
Program p = new Program();
if (n == 1)
{
p.add(a, b);
}
else if (n == 2)
{
p.sub(a, b);
}
else if (n == 3)
{
p.mul(a, b);
}
else if (n == 4)
{
p.div(a, b);
}
else
{
Console.WriteLine("YOU ARE ENTERING WRONG CHOICE");
}
Console.ReadKey();
}
public void add(int a, int b)
Om Shanti Engg. College - 2012 1
2. 090360116058 Dot Net Technology
{
int c;
c = a + b;
Console.WriteLine("Addition is " + c);
}
public void sub(int a, int b)
{
int c;
c = a - b;
Console.WriteLine("Substraction is " + c);
}
public void mul(int a, int b)
{
int c;
c = a * b;
Console.WriteLine("Multiplication is " + c);
}
public void div(int a, int b)
{
int c;
c = a / b;
Console.WriteLine("Division is " + c);
}
}
}
Om Shanti Engg. College - 2012 2
3. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 3
4. 090360116058 Dot Net Technology
Console Calculator.vb
Module Module1
Sub Main()
Dim a, b, c As Integer
Console.WriteLine("Enter Value of a")
a = Convert.ToInt16(Console.ReadLine())
Console.WriteLine("Enter Value of a")
b = Convert.ToInt16(Console.ReadLine())
c = a + b
Console.WriteLine("Addition")
Console.WriteLine(+c)
c = a - b
Console.WriteLine("Substraction")
Console.WriteLine(+c)
c = a * b
Console.WriteLine("Multiplication")
Console.WriteLine(+c)
c = a / b
Console.WriteLine("Division")
Console.WriteLine(+c)
Console.ReadKey()
End Sub
End Module
Om Shanti Engg. College - 2012 4
5. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 5
6. 090360116058 Dot Net Technology
Windows Calculator.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace VBWindowsFormsApplicationCalculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Button1_Click(object sender, EventArgs e)
{
txtAns.Text = (Convert.ToInt32(txtA.Text) +
Convert.ToInt32(txtB.Text)).ToString();
}
private void Button2_Click(object sender, EventArgs e)
{
txtAns.Text = (Convert.ToInt32(txtA.Text) -
Convert.ToInt32(txtB.Text)).ToString();
}
private void Button3_Click(object sender, EventArgs e)
{
txtAns.Text = (Convert.ToInt32(txtA.Text) *
Convert.ToInt32(txtB.Text)).ToString();
}
private void Button4_Click(object sender, EventArgs e)
{
txtAns.Text = (Convert.ToInt32(txtA.Text) /
Convert.ToInt32(txtB.Text)).ToString();
}
}
}
Om Shanti Engg. College - 2012 6
7. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 7
8. 090360116058 Dot Net Technology
Windows Calculator.vb
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
TextBox3.Text = Convert.ToInt32(TextBox1.Text) +
Convert.ToInt32(TextBox2.Text)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox3.Text = Convert.ToInt32(TextBox1.Text) -
Convert.ToInt32(TextBox2.Text)
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
TextBox3.Text = Convert.ToInt32(TextBox1.Text) *
Convert.ToInt32(TextBox2.Text)
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
TextBox3.Text = Convert.ToInt32(TextBox1.Text) /
Convert.ToInt32(TextBox2.Text)
End Sub
End Class
Om Shanti Engg. College - 2012 8
9. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 9
10. 090360116058 Dot Net Technology
PRACTICAL NO: 2
AIM: Implement a C# Application to Study Inheritance , Constructor and
Overloading.
Inheritance.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSConsoleInheritance
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Inheritance Programn");
Console.WriteLine("Creating Object of Derive classn");
Derive d=new Derive();
Console.WriteLine("Calling Base class method");
d.Display();
Console.WriteLine("Calling Derive class method");
d.Print();
Console.ReadKey();
}
}
class BaseClass
{
public void Display()
{
Console.WriteLine("This is Base class Display() methodn");
}
}
class Derive :BaseClass
{
public void Print()
{
Console.WriteLine("This is derive class Print() method");
}
}
}
Om Shanti Engg. College - 2012 10
11. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 11
12. 090360116058 Dot Net Technology
ConstuctorOverloding.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSConsoleConstructorOverLoading
{
class Program
{
public Program()
{
Console.WriteLine("This is Default Constructorn");
}
public Program(String nm)
{
Console.WriteLine("This is one Parameter Constructor");
Console.WriteLine("My Name is : " + nm + "n");
}
public Program(int a, string nm)
{
Console.WriteLine("This is two Parameter Constructor");
Console.WriteLine("My Name is : " + nm + " and i am : " + a + " years old
");
}
~Program()
{
Console.WriteLine("I am calling Destructor");
}
public static void Main(string[] args)
{
Console.WriteLine("This is Costructor and Destructor in C#n");
Program prg = new Program();
Program prg1 = new Program("abc");
Program prg2 = new Program(20, "abc");
Console.ReadKey();
}
}
}
Om Shanti Engg. College - 2012 12
13. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 13
14. 090360116058 Dot Net Technology
PRACTICAL NO: 3
AIM:Write a Programm to Demostrate the use of property and indexer.
Read & Write Property.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSConsoleProperty
{
class Program
{
private string BookName = "abc";
private int BookPrice = 500;
public string MyBookName
{
get
{
return BookName;
}
set
{
BookName = value;
}
}
public int MyBookPrice
{
get
{
return BookPrice;
}
set
{
BookPrice = value;
}
}
public override string ToString()
{
return ("BookName is : " + BookName + " Price is : " + BookPrice);
}
static void Main(string[] args)
{
Program p = new Program();
Console.WriteLine("This is Read & Write Property Programn");
Console.WriteLine("Default values is :");
Console.WriteLine(p+"n");
p.BookName = ".net Black Book";
p.BookPrice = 450;
Console.WriteLine("Changed Value is :");
Console.WriteLine(p);
Console.ReadKey(); }
}
}
Om Shanti Engg. College - 2012 14
15. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 15
16. 090360116058 Dot Net Technology
Read Only Property.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSConsoleProperty2
{
class ReadOnly
{
private string BookName = "abc";
private int BookPrice = 500;
public ReadOnly()
{ }
public ReadOnly(String Name,int Price)
{
BookName = Name;
BookPrice = Price;
}
public string MyBookName
{
get
{
return BookName;
}
}
public int MyBookPrice
{
get
{
return BookPrice;
}
}
public override string ToString()
{
return ("BookName is : " + BookName + " and Price is : " + BookPrice);
}
static void Main(string[] args)
{
ReadOnly p = new ReadOnly();
Console.WriteLine("This is Read only Propertyn");
Console.WriteLine("Default values is :");
Console.WriteLine(p + "n");
ReadOnly p1 = new ReadOnly(".net Black Book", 450);
Console.WriteLine("Changed Value is :");
Console.WriteLine(p1);
Console.ReadKey();
}
}
}
Om Shanti Engg. College - 2012 16
17. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 17
18. 090360116058 Dot Net Technology
Static Property.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CSConsoleProperty3
{
class Static
{
static void Main(string[] args)
{
Console.WriteLine("Static Property Programn");
Console.WriteLine("Number of Object : {0}",CounterClass.NumberOfObject);
CounterClass Object1 = new CounterClass();
Console.WriteLine("Number of Object : {0}", CounterClass.NumberOfObject);
CounterClass Object2 = new CounterClass();
Console.WriteLine("Number of Object : {0}", CounterClass.NumberOfObject);
CounterClass Object3 = new CounterClass();
Console.WriteLine("Number of Object : {0}", CounterClass.NumberOfObject);
Console.ReadKey();
}
}
public class CounterClass
{
private static int n = 0;
public CounterClass()
{
n++;
}
public static int NumberOfObject
{
get
{
return n;
}
set
{
n = value;
}
}
}
}
Om Shanti Engg. College - 2012 18
19. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 19
20. 090360116058 Dot Net Technology
Indexer.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace indexer
{
class indexers
{
int[] a = new int[3];
public int this[int index]
{
get
{
if (index < 0 && index > 3)
{
return 0;
}
else
{
return a[index];
}
}
set
{
a[index] = value;
}
}
}
class Program
{
static void Main(string[] args)
{
Console.WriteLine("This is indexer Programn");
indexers i = new indexers();
i[0] = 100;
i[1] = 200;
i[2] = 300;
for (int j = 0; j <= 2; j++)
{
Console.WriteLine("Value is : " + i[j]);
}
Console.WriteLine("Changing values");
i[0] = 101;
i[1] = 202;
i[2] = 303;
for (int j = 0; j <= 2; j++)
{
Console.WriteLine("Value is : " + i[j]);
}
Console.ReadKey();
} } }
Om Shanti Engg. College - 2012 20
21. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 21
22. 090360116058 Dot Net Technology
PRACTICAL NO: 4
AIM: Write a Program for explaining events and Delegates in C# .NET.
Events.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace events
{
public delegate void eventhandler();
class Program
{
public static event eventhandler show;
static void Main(string[] args)
{
Console.WriteLine("This is events Programn");
show += new eventhandler(Dog);
show += new eventhandler(Cat);
show += new eventhandler(Mouse);
show += new eventhandler(Mouse);
show.Invoke();
Console.ReadKey();
}
static void Dog()
{
Console.WriteLine("Dog");
}
static void Cat()
{
Console.WriteLine("Cat");
}
static void Mouse()
{
Console.WriteLine("Mouse");
}
}
}
Om Shanti Engg. College - 2012 22
23. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 23
24. 090360116058 Dot Net Technology
Delegates.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace delegates
{
class Program
{
public delegate int calci(int i, int j);
public static int add(int a, int b)
{
return a + b;
}
public static int sub(int a, int b)
{
return a - b;
}
public static int mul(int a, int b)
{
return a * b;
}
public static int div(int a, int b)
{
return a / b;
}
static void Main(string[] args)
{
Console.WriteLine("This is delegates Programn");
calci c;
c = add;
Console.WriteLine("add {0}", c.Invoke(50, 20));
c = sub;
Console.WriteLine("sub {0}", c.Invoke(100, 20));
c = mul;
Console.WriteLine("mul {0}", c.Invoke(50, 25));
c = div;
Console.WriteLine("div {0}", c.Invoke(30, 30));
Console.ReadKey();
}
}
}
Om Shanti Engg. College - 2012 24
25. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 25
26. 090360116058 Dot Net Technology
PRACTICAL NO: 5
AIM: Implement Windows Form based application using controls like
menus, dialog and tool tip etc.
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
End Sub
Private Sub FileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles FileToolStripMenuItem.Click
End Sub
Private Sub ToolStrip1_ItemClicked(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.ToolStripItemClickedEventArgs)
End Sub
Private Sub EditToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles EditToolStripMenuItem.Click
End Sub
Private Sub ProjectToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles ProjectToolStripMenuItem.Click
End Sub
Private Sub HelpToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles HelpToolStripMenuItem.Click
End Sub
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles NewToolStripMenuItem.Click
End Sub
End Class
Om Shanti Engg. College - 2012 26
27. 090360116058 Dot Net Technology
OUTPUT :
.
Om Shanti Engg. College - 2012 27
28. 090360116058 Dot Net Technology
PRACTICAL NO: 6
AIM: Implement a VB 2008 Application to study Error Handling.
Error Handling.cs
Module Module1
Sub Main()
Dim a As Integer
Dim b As Integer = 1
Dim c As Integer = 0
Try
a = b c
Catch exc As Exception
Console.WriteLine("A run-time error occurred")
Finally
Console.ReadLine()
End Try
End Sub
End Module
Om Shanti Engg. College - 2012 28
29. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 29
30. 090360116058 Dot Net Technology
PRACTICAL NO: 7
AIM: Implement concepts of Inheritance, visual inheritance and Interface
in windows application.
Public Interface person
Sub setnum(ByVal n1 As Double, ByVal n2 As Double)
Function getsum() As Double
End Interface
Public Class employee Implements person
Dim s1 As Double
Public Function getsum() As Double Implements person.getsum
Return s1
End Function
Public Sub setnum(ByVal n1 As Double, ByVal n2 As Double) Implements person.setnum
s1 = n1 + n2
End Sub
Public Sub substraction(ByVal n1 As Double, ByVal n2 As Double)
Dim d3 As Double = n1 - n2
System.console.writeline("The substraction interface is: " & d3)
End Sub
End Class
Public Class demo Inherits employee
Public Sub mul(ByVal n1 As Double, ByVal n2 As Double)
Dim d3 As Double= n1 * n2
System.Console.WriteLine("The multiplication using inheritance is : " & d3)
End Sub
End Class
Module Module1
Sub Main()
Dim d As New employee()
Dim d5 As New demo()
Console.WriteLine("Enter a digit:")
Dim d1 As Double = CDbl(Console.ReadLine())
Console.WriteLine("Enter a digit:")
Dim d2 As Double = CDbl(Console.ReadLine())
d.setnum(d1, d2)
System.Console.WriteLine("The sum using interface is: " & d.getsum)
d5.substraction(d1, d2) System.console.writeline() d5.mul(d1, d2)
End Sub
End Module
Om Shanti Engg. College - 2012 30
31. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 31
32. 090360116058 Dot Net Technology
PRACTICAL NO: 8
AIM: Use Dataset, Data Reader, XML Reader & Data Sources (SQL,
Object & XML) with Any Windows or Web Application.
DataSet
using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace WebApplication1
{
public partial class assDataset : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=HARDIK-
B652B097SQLEXPRESS;Initial Catalog=db1;Integrated Security=True");
SqlDataAdapter adapt;
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
adapt = new SqlDataAdapter("select * from Employee", con);
adapt.Fill(ds, "Employee");
con.Close();
}
}
}
DataReader
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace WebApplication1
{
public partial class assrreader : System.Web.UI.Page
{
SqlConnection con = new SqlConnection("Data Source=HARDIK-
B652B097SQLEXPRESS;Initial Catalog=db2;Integrated Security=True");
SqlCommand cmd;
SqlDataReader reader;
String str;
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
Om Shanti Engg. College - 2012 32
33. 090360116058 Dot Net Technology
cmd = new SqlCommand("Select * from Employee", con);
reader = cmd.ExecuteReader();
reader.Close();
con.Close();
}
}
}
XMLReader
using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace WebApplication1
{
public partial class assXMLReader : System.Web.UI.Page
{
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
ds.ReadXml(Server.MapPath("~/assXML.xml"));
}
}
}
Om Shanti Engg. College - 2012 33
47. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 47
48. 090360116058 Dot Net Technology
PRACTICAL NO: 13
AIM: Create a Web Application in ASP.NET using various CSS.
Cssdemo1(.css file)
/* header start */
.main_bg
{
width:100%;
background:url(../images/homebg_header.gif) repeat-x left top;
margin:0 auto;
}
.header_image
{
width:1003px;
height:1153px;
background-color:Teal;
margin:0 auto;
}
.bottom_image
{
width:1003px;
height:153px;
background-color:Silver;
margin:top 153px;
}
Cssdemo2(.css file)
/* general top nav */
.top_links
{
width:295px;
float:right;
margin:15px 0 0 0;
}
.top_links ul
{
list-style:none;
}
.top_links ul li
{
float:left;
display:block;
}
.top_links ul li a
{
text-decoration:none;
Om Shanti Engg. College - 2012 48
50. 090360116058 Dot Net Technology
<li><a target="_blank" href="http://www.freedomdesigns.in">UK</a></li>
</ul>
</div>
</li>
</ul>
<br />
</form>
</body>
</html>
Om Shanti Engg. College - 2012 50
51. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 51
52. 090360116058 Dot Net Technology
PRACTICAL NO: 14
AIM: Implement the concept of state management in a web application.
.asax file(Global Application file)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
namespace WebApplication1
{
public class Global : System.Web.HttpApplication
{
protected void Application_Start(object sender, EventArgs e)
{
Application["count"] = 0;
}
protected void Session_Start(object sender, EventArgs e)
{ }
protected void Application_BeginRequest(object sender, EventArgs e)
{ }
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{ }
protected void Application_Error(object sender, EventArgs e)
{ }
protected void Session_End(object sender, EventArgs e)
{ }
protected void Application_End(object sender, EventArgs e)
{ }
}
}
.aspx file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebForm3 : System.Web.UI.Page
Om Shanti Engg. College - 2012 52
53. 090360116058 Dot Net Technology
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Application.Lock();
Application["count"] = (int)Application["count"] + 1;
Response.Write("Visitor No.=" + Application["count"]);
Application.UnLock();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["name"] = TextBox1.Text;
Session["pwd"] = TextBox2.Text;
Response.Redirect("NextPage.aspx");
}
}
}
Code Behind File
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class WebForm3 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Application.Lock();
Application["count"] = (int)Application["count"] + 1;
Response.Write("Visitor No.=" + Application["count"]);
Application.UnLock();
}
}
protected void Button1_Click(object sender, EventArgs e)
{
Session["name"] = TextBox1.Text;
Session["pwd"] = TextBox2.Text;
Response.Redirect("NextPage.aspx");
}
}
}
Om Shanti Engg. College - 2012 53
54. 090360116058 Dot Net Technology
NextPage.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class NextPage : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Welcome " + Session["name"] + ". Your password is " + Session["pwd"]);
}
}
}
Om Shanti Engg. College - 2012 54
55. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 55
56. 090360116058 Dot Net Technology
PRACTICAL NO: 15
AIM: Implement code in ASP.NET that creates and consumes Web service.
.asmx file(WebService)
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data.SqlClient;
namespace WebApplication1
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
public class assWebServic : System.Web.Services.WebService
{
SqlConnection con=new SqlConnection("Data Source=HARDIK-
B652B097SQLEXPRESS;Initial Catalog=db1;Integrated Security=True");
SqlDataAdapter adapt;
DataSet ds=new DataSet();
[WebMethod]
public DataSet show()
{
con.Open();
adapt = new SqlDataAdapter("Select * from Student", con);
adapt.Fill(ds, "Student");
con.Close();
return ds;
}
}
}
.aspx file
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="assWebServic.aspx.cs"
Inherits="WebApplication1.assWebServic1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Om Shanti Engg. College - 2012 56
57. 090360116058 Dot Net Technology
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
</html>
Code Behind File
using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class assWebServic1 : System.Web.UI.Page
{
DataSet ds = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
localhost1.assWebServic obj = new localhost1.assWebServic();
ds=obj.show();
GridView1.DataSource = ds;
GridView1.DataBind();
}
}
}
Om Shanti Engg. College - 2012 57
58. 090360116058 Dot Net Technology
OUTPUT :
Om Shanti Engg. College - 2012 58
59. 090360116058 Dot Net Technology
PRACTICAL NO: 16
AIM: Study of ASP.NET administration and configuration tool.
The Web Site Administration Tool is used to configure the application and security settings of
an ASP.NET Web Application. We can use this tool to perform following tasks:
Configuring the application security settings, such as authentication and authorization.
Managing users and roles for an application.
Creating and managing application settings.
Configuring SMTP email settings.
Making an application temporarily offline to update its content and data in a secure manner.
Adjusting the debugging and tracing settings.
Defining a default custom error page.
Selecting providers to use them with the site features, such as membership.
STEPS TO WEBSITE ADMINISTRATION TOOL:
1) HOME
Om Shanti Engg. College - 2012 59
60. 090360116058 Dot Net Technology
2) SECURITY
3) APPLICATION
Om Shanti Engg. College - 2012 60
61. 090360116058 Dot Net Technology
4 ) PROVIDER
Om Shanti Engg. College - 2012 61