Professional Documents
Culture Documents
Awt Full
Awt Full
FYMCA , ROLL NO 12
PRACTICAL NO 1
cs code :
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
else
{
gender = "FEMALE";
}
string feedback;
if (c1.Checked)
{
feedback = "GOOD";
}
else
{
feedback = "BAD";
}
l5.Text = "Name is " + name + "\nEmail is " + email
+ "\nGender is " + gender + "\nfeedback is " + feedback;
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 2
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
else
{
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
c = Convert.ToDouble(textBox1.Text);
textBox2.Text = Convert.ToString((c * 1.8) + 32);
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 3
cs code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace prac3
{
class Program
{
static void Main(string[] args)
{
DateTime d = DateTime.Now;
Console.WriteLine("ROLL NO 12");
Console.WriteLine(d);
d.AddDays(5);
Console.WriteLine(d.AddDays(5));
d.AddYears(2);
Console.WriteLine(d.AddYears(2));
d.AddMonths(5);
Console.WriteLine(d.AddMonths(5));
d.AddMinutes(5);
Console.WriteLine(d.AddMinutes(5));
d.AddSeconds(5);
Console.WriteLine(d.AddSeconds(5));
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 4
cs Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace prac4
{
class shaggy
{
PRACTICAL NO 5
Simple Inheritance
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Prac2
{
class Parent
{
public void display()
{
Console.WriteLine("This is parent class");
}
}
class Program
{
static void Main(string[] args)
{
child c = new child();
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
c.display();
c.display1();
Console.ReadLine();
}
}
}
MULTIPLE INHERITANCE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Prac2
{
public interface if1
{
void display();
}
{
Console.WriteLine("Interface 1");
}
MULTILEVEL INHERITANCE
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Prac2
{
class Parent1
{
public void display()
{
Console.WriteLine("This is Parent Class");
}
}
class multilevel
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
{
static void Main(string[] args)
{
child2 c2 = new child2();
c2.display();
c2.display1();
c2.display2();
Console.ReadLine();
}
}
}
Hierarchical Inheritance.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Prac2
{
class Parent2
{
public void display()
{
Console.WriteLine("This is Parent Class");
}
}
class child3 : Parent2
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
{
public void display1()
{
Console.WriteLine("This is Child1 Class");
}
}
class child4 : Parent2
{
public void display2()
{
Console.WriteLine("This is Child2 Class");
}
}
class heirarchical
{
static void Main(string[] args)
{
child3 c3 = new child3();
c3.display();
c3.display1();
child4 c4 = new child4();
c4.display();
c4.display2();
Console.ReadLine();
}
}
}
PRACTICAL NO 6
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
cs Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Prac2
{
public abstract class customer
{
public abstract void print();
}
public class abstrac : customer
{
public override void print()
{
Console.WriteLine("abstarct class");
}
static void Main(string[] args)
{
abstrac a = new abstrac();
a.print();
Console.ReadLine();
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 7
Site1.master
<!DOCTYPE html>
<html>
<head runat="server">
<title></title>
<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>
<body style="height: 535px">
<form id="form1" runat="server">
<div style="height: 517px">
<div class="wrapper">
<div class="menu">
<ul>
<li> <a href="home.aspx"> HOME </a></li>
<li> <a href="contact.aspx"> CONTACT </a></li>
<li> <a href="about.aspx"> ABOUT US </a></li>
<li> <a href="product.aspx"> PRODUCT </a></li>
</ul>
</div>
<div class="content">
<asp:ContentPlaceHolder ID="ContentPlaceHolder1"
runat="server">
</asp:ContentPlaceHolder>
</div>
</div>
</div>
</form>
</body>
</html>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
Home.aspx:
Contact.aspx:
Product.aspx:
</asp:Content>
<asp:Content ID="Content2"
ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<p>This is product page</p>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
</asp:Content>
About.aspx:
OUTPUT:
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 8
calcy.cs
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
 
; &nbs
p;
<asp:Label ID="Label4" runat="server" Text="Roll No:
12"></asp:Label>
<br />
<br />
<asp:Label ID="Label1" runat="server" Text="Enter
First Number: "></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"
style="margin-left: 53px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="Enter
Second Number: "></asp:Label>
<asp:TextBox ID="TextBox2" runat="server"
style="margin-left: 36px"></asp:TextBox>
<br />
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
<br />
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="Add" Width="47px" />
<asp:Button ID="Button2" runat="server"
OnClick="Button2_Click" Text="Subtract" />
<asp:Button ID="Button3" runat="server"
OnClick="Button3_Click" Text="Multiply" Width="56px" />
<asp:Button ID="Button4" runat="server"
OnClick="Button4_Click" Text="Divide" />
<br />
<br />
 
; &nbs
p; &nb
sp;
<asp:Label ID="Label3" runat="server"></asp:Label>
</div>
</form>
</body>
</html>
Calcy.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Calculator
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
PRACTICAL NO 9
 
;
<asp:Label ID="Label1" runat="server"
Text="REGISTRATION FORM"></asp:Label>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="FIRST
NAME"></asp:Label>
 
;
<asp:TextBox ID="t1" runat="server"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="LAST
NAME"></asp:Label>
 
;
<asp:TextBox ID="t2" runat="server"></asp:TextBox>
<br />
<br />
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
WebForm1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class WebForm1 : System.Web.UI.Page
{
{
l8.Text += "\nSKILLS " + lst.Text + "<br/>";
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 10
webform1.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication2
{
public partial class WebForm1 : System.Web.UI.Page
{
Webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1"
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 600px">
 
;
<asp:Label ID="Label1" runat="server"
Text="REGISTRATION FORM"></asp:Label>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="FIRST
NAME"></asp:Label>
 
; <asp:TextBox ID="t1"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator1" runat="server"
ErrorMessage="RequiredFieldValidator" ControlToValidate="t1"
ForeColor="Red"></asp:RequiredFieldValidator>
<br />
<br />
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
<asp:RequiredFieldValidator
ID="RequiredFieldValidator2" runat="server"
ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidato
r>
<br />
<br />
<asp:Label ID="Label4" runat="server"
Text="AGE"></asp:Label>
 
;
<asp:TextBox ID="t3" runat="server"></asp:TextBox>
<asp:RangeValidator ID="RangeValidator1"
runat="server"
ErrorMessage="RangeValidator"></asp:RangeValidator>
<br />
<br />
<asp:Label ID="Label7" runat="server" Text="Email
Id"></asp:Label>
 
;
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ErrorMessage="RegularExpressionValidator"></asp:RegularExpression
Validator>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
<br />
<br />
<asp:Label ID="Label10" runat="server" Text="User
Id"></asp:Label>
 
;
<asp:TextBox ID="TextBox4"
runat="server"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label8" runat="server"
Text="Password"></asp:Label>
 
;
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
<asp:RequiredFieldValidator
ID="RequiredFieldValidator3" runat="server"
ErrorMessage="RequiredFieldValidator" ControlToValidate="t1"
ForeColor="Red"></asp:RequiredFieldValidator>
<br />
<br />
<asp:Label ID="Label9" runat="server" Text="Confirm
Password"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server"
OnTextChanged="TextBox3_TextChanged"></asp:TextBox>
 
;
<asp:CompareValidator ID="CompareValidator1"
runat="server"
ErrorMessage="CompareValidator"></asp:CompareValidator>
<br />
<br />
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
</form>
</body>
</html>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 11
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication8
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Calendar1_SelectionChanged(object sender,
EventArgs e)
{
Response.Write("Your Selected Date is: ");
Response.Write(Calendar1.SelectedDate.ToShortDateString());
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 12
Aim: Design a Web Page to show ice-cream flavor selected by user using
AutoPostBack property.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Example of AutoPostBack<br />
<br />
Select ice-cream from the box<br />
<br />
<asp:ListBox ID="ListBox1" AutoPostBack="true"
runat="server">
<asp:ListItem>Chocolate</asp:ListItem>
<asp:ListItem>Vanilla</asp:ListItem>
<asp:ListItem>Strawberry</asp:ListItem>
<asp:ListItem>Cheesecake</asp:ListItem>
</asp:ListBox>
<br />
<br />
<asp:Label ID="Label1" runat="server"
Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
aurtopost.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace AutoPostBack
{
public partial class aurtopost : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(ListBox1.SelectedItem != null)
{
Label1.Text = "Flavour of your ice-cream (Yash)"
+ ListBox1.SelectedItem.Value;
}
else
{
Label1.Text = "";
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 13
Webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication9.WebForm1"
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
ROll NO 12
<asp:TreeView ID="TreeView1" runat="server">
<Nodes>
<asp:TreeNode Text="HOME" Value="HOME"
NavigateUrl="~/Webform1.aspx"></asp:TreeNode>
<asp:TreeNode Text="Employee"
Value="Employee">
<asp:TreeNode Text="Upload Resume"
Value="Upload Resume"
NavigateUrl="~/uploadaspx.aspx"></asp:TreeNode>
<asp:TreeNode Text="Edit Resume"
Value="Edit Resume" NavigateUrl="~/edit.aspx"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode Text="Logout" Value="Logout"
NavigateUrl="~/logout.aspx"></asp:TreeNode>
</Nodes>
</asp:TreeView>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
</div>
</form>
</body>
</html>
Upload.aspx
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="uploadaspx.aspx.cs"
Inherits="WebApplication9.uploadaspx" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Upload Succesfull
</div>
</form>
</body>
</html>
Edit.aspx
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="edit.aspx.cs" Inherits="WebApplication9.edit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
<div>
Edit your resume
</div>
</form>
</body>
</html>
Logout.aspx
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="logout.aspx.cs" Inherits="WebApplication9.logout" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Logout Successfull
</div>
</form>
</body>
</html>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 14
Page1.aspx
Source code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 446px">
<asp:Label ID="Label1" runat="server"
Text="Name"></asp:Label>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="E-
mail"></asp:Label>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" style="margin-left: 48px" Text="Go Next
Page" Width="127px" />
</div>
</form>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
</body>
</html>
Page1.aspx.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Practical27
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page2.aspx
Source code:
<!DOCTYPE html>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 537px">
<asp:Label ID="Label1" runat="server"
Text="Name"></asp:Label>
<asp:Label ID="Label2" runat="server"
Text="Label"></asp:Label>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="E-
mail"></asp:Label>
<asp:Label ID="Label4" runat="server"
Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
Page.aspx.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Practical27
{
public partial class session2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
{
if(Session["Name"]!=null)
{
Label2.Text = Session["Name"].ToString();
}
if(Session["E-mail"]!=null)
{
Label4.Text = Session["E-mail"].ToString();
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 15
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" Text="Create Cookie" Width="136px" />
<asp:TextBox ID="TextBox1" runat="server" style="margin-
left: 56px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button2" runat="server"
OnClick="Button2_Click" Text="Retrieve Cookie" />
<asp:TextBox ID="TextBox2" runat="server" style="margin-
left: 56px"></asp:TextBox>
</div>
</form>
</body>
</html>
cookie.aspx
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
using System.Web.UI.WebControls;
namespace AutoPostBack
{
public partial class cookie : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Response.Cookies["user"].Value = TextBox1.Text;
Response.Cookies["user"].Expires =
DateTime.Now.AddMinutes(1);
TextBox1.Text = "";
}
protected void Button2_Click(object sender, EventArgs e)
{
if(Request.Cookies["user"]!=null)
{
TextBox2.Text = Request.Cookies["user"].Value;
}
else
{
TextBox2.Text = "Biscuit not found";
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 16
Webserver.aspx
Souce code:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="web_server.aspx.cs"
Inherits="Sql_server_Pract.web_server" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<br />
<br />
<asp:Label ID="Label4" runat="server" Font-Size="X-
Large" Text="SQL Server Program (RollNo:33)"></asp:Label>
<br />
<br />
<asp:Label ID="Label1" runat="server"
Text="RollNo"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"
style="margin-left: 54px"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server"
Text="FirstName"></asp:Label>
<asp:TextBox ID="TextBox2" runat="server"
style="margin-left: 34px"></asp:TextBox>
<br />
<br />
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
<asp:Label ID="Label3" runat="server"
Text="LastName"></asp:Label>
<asp:TextBox ID="TextBox3" runat="server"
style="margin-left: 38px"></asp:TextBox>
<br />
<br />
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" style="margin-left: 32px" Text="Save"
Width="62px" />
<asp:Button ID="Button2" runat="server"
OnClick="Button2_Click" style="margin-left: 49px"
Text="Update" />
<asp:Button ID="Button3" runat="server"
OnClick="Button3_Click" style="margin-left: 59px"
Text="Delete" />
<br />
<br />
<asp:Label ID="Label5" runat="server"
Text="OutPut"></asp:Label>
<br />
<br />
<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
style="margin-left: 35px">
<Columns>
<asp:BoundField DataField="Rollno"
HeaderText="Rollno" SortExpression="Rollno"></asp:BoundField>
<asp:BoundField DataField="firstname"
HeaderText="firstname"
SortExpression="firstname"></asp:BoundField>
<asp:BoundField DataField="lastname"
HeaderText="lastname" SortExpression="lastname"></asp:BoundField>
</Columns>
</asp:GridView>
<br />
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
Webserver.aspx.cs
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
namespace Sql_server_Pract
{
public partial class web_server : System.Web.UI.Page
{
string connStr =
ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
cmd.Parameters.AddWithValue("@RollNo",
TextBox1.Text);
cmd.Parameters.AddWithValue("@firstName",
TextBox2.Text);
cmd.Parameters.AddWithValue("@lastName",
TextBox3.Text);
int result = cmd.ExecuteNonQuery();
if (result > 0)
{
Label5.Text = "Record Successfully Deleted :)";
}
else
{
Label5.Text = "Record Not Deleted :(";
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 17
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace WindowsFormsApp2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Form1_Load();
}
con.Open();
SqlDataReader sr = cmd.ExecuteReader();
CB_Name.Items.Add("Selected Name");
CB_Name.SelectedIndex = 0;
if (sr.HasRows)
{
while (sr.Read())
{
CB_Name.Items.Add(sr["Name"].ToString());
}
}
con.Close();
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 18
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Form1_Load();
}
// Disconnected Architecture
SqlConnection con = new
SqlConnection(@"Server=(localdb)\MSSQLLocalDB;
Database=Student27; Integrated Security=True");
SqlCommand cmd = new SqlCommand("select Name from
Registration", con);
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
con.Close();
CB_Name.Items.Add("Select Name");
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
CB_Name.SelectedIndex = 0;
DataSet ds = new DataSet();
sda.Fill(ds);
if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count >
0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow dro = ds.Tables[0].Rows[i];
CB_Name.Items.Add(dro["Name"].ToString());
}
}
}
//Disconnected Architecture
SqlConnection con = new
SqlConnection(@"Server=(localdb)\MSSQLLocalDB;
Database=Student27; Integrated Security=True");
SqlCommand details_cmd = new SqlCommand("select *
from Registration where name=@name", con);
details_cmd.Parameters.AddWithValue("@name",
CB_Name.SelectedItem.ToString());
con.Open();
SqlDataAdapter sda = new
SqlDataAdapter(details_cmd);
con.Close();
DataSet ds = new DataSet();
sda.Fill(ds);
DGV.DataSource = ds.Tables[0];
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 19
Page1.aspx
Source code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 446px">
<asp:Label ID="Label1" runat="server"
Text="Name"></asp:Label>
<asp:TextBox ID="TextBox1"
runat="server"></asp:TextBox>
<br />
<br />
<asp:Label ID="Label2" runat="server" Text="E-
mail"></asp:Label>
<asp:TextBox ID="TextBox2"
runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="Button1" runat="server"
OnClick="Button1_Click" style="margin-left: 48px" Text="Go Next
Page" Width="127px" />
</div>
</form>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
</body>
</html>
Page1.aspx.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Practical27
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page2.aspx
Source code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div style="height: 537px">
<asp:Label ID="Label1" runat="server"
Text="Name"></asp:Label>
<asp:Label ID="Label2" runat="server"
Text="Label"></asp:Label>
<br />
<br />
<asp:Label ID="Label3" runat="server" Text="E-
mail"></asp:Label>
<asp:Label ID="Label4" runat="server"
Text="Label"></asp:Label>
</div>
</form>
</body>
</html>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
Page.aspx.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace Practical27
{
public partial class session2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if(Session["Name"]!=null)
{
Label2.Text = Session["Name"].ToString();
}
if(Session["E-mail"]!=null)
{
Label4.Text = Session["E-mail"].ToString();
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 20
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
Form1_Load();
}
// Disconnected Architecture
SqlConnection con = new
SqlConnection(@"Server=(localdb)\MSSQLLocalDB;
Database=Student27; Integrated Security=True");
SqlCommand cmd = new SqlCommand("select Name from
Registration", con);
con.Open();
SqlDataAdapter sda = new SqlDataAdapter(cmd);
con.Close();
CB_Name.Items.Add("Select Name");
CB_Name.SelectedIndex = 0;
DataSet ds = new DataSet();
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
sda.Fill(ds);
if (ds.Tables.Count > 0 && ds.Tables[0].Rows.Count >
0)
{
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
DataRow dro = ds.Tables[0].Rows[i];
CB_Name.Items.Add(dro["Name"].ToString());
}
}
}
//Disconnected Architecture
SqlConnection con = new
SqlConnection(@"Server=(localdb)\MSSQLLocalDB;
Database=Student27; Integrated Security=True");
SqlCommand details_cmd = new SqlCommand("select *
from Registration where name=@name", con);
details_cmd.Parameters.AddWithValue("@name",
CB_Name.SelectedItem.ToString());
con.Open();
SqlDataAdapter sda = new
SqlDataAdapter(details_cmd);
con.Close();
DataSet ds = new DataSet();
sda.Fill(ds);
DGV.DataSource = ds.Tables[0];
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 21
Aim: Design a web application to perform CRUD Operation Using LinQ.
Webform.aspx:
Soucre code:
<%@ Page Language="C#" AutoEventWireup="true"
CodeBehind="WebForm1.aspx.cs" Inherits="linq_pract21.WebForm1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
width: 100%;
}
.auto-style2 {
width: 305px;
height: 229px;
}
.auto-style4 {
margin-left: 345px;
}
.auto-style5 {
width: 305px;
height: 45px;
}
.auto-style6 {
height: 45px;
}
.auto-style7 {
width: 305px;
height: 48px;
}
.auto-style8 {
height: 48px;
}
.auto-style9 {
width: 305px;
height: 41px;
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
.auto-style10 {
height: 41px;
}
.auto-style11 {
width: 305px;
height: 76px;
}
.auto-style12 {
height: 76px;
}
.auto-style13 {
height: 229px;
}
.auto-style14 {
height: 58px;
}
.auto-style15 {
height: 113px;
}
.auto-style16 {
height: 57px;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>
<table class="auto-style1">
<tr>
<td colspan="2" style="font-size:x-large;
color:#000080; background-color:#808080; font-style: inherit;"
class="auto-style8">
 
; &nbs
p; &nb
sp; CRUD Operation Using LinQ C#</td>
</tr>
<tr>
<td class="auto-style5">
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
Webform.aspx.cs
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace linq_pract21
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
//LinQ Class File
DataClasses1DataContext db = new
DataClasses1DataContext();//insertion activity will perform using
this
ScriptManager.RegisterStartupScript(this,
this.GetType(), "script","alert('Successfully Inserted');",true);
}
catch(Exception ex)
{
ScriptManager.RegisterStartupScript(this,
this.GetType(), "script", "alert('" + ex.Message.ToString() +
"');", true);
}
}
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 22
Webservice.asmx.cs
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace webservice_pract22
{
/// <summary>
/// Summary description for WebService1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using
ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class WebService1 : System.Web.Services.WebService
{
[WebMethod]
public int Add(int firstNumber ,int secondNumber)
{
return firstNumber + secondNumber;
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 23
PRACTICAL NO 24
Altering StoreProcedure:
create procedure InsertUserInfo
@userId int,
@userName nvarchar(15),
@address nvarchar(15),
@age int,
@gender nvarchar(15)
As
begin
insert into AIML_00
values(@userId,@userName,@address,@age,@gender,'1/1/1995');
end;
Practical NO 25
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
namespace WebApplication11
{
public class HomeController : Controller
{
public string Index()
{
return "Hello everyone this is my first page ..";
}
public string GetDetails()
{
return "Roll no : 12, Invoked GetDetails...";
}
}
}
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
PRACTICAL NO 26
Aim: Design a web application to produce and consume WCF
Services.
IFirstWebService.cs
Source Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace FirstWCFWebService
{
// NOTE: You can use the "Rename" command on the "Refactor"
menu to change the interface name "IFirstWebServices" in both
code and config file together.
[ServiceContract]
public interface IFirstWebServices
{
[OperationContract]
string Message();
}
}
FirstWebService.svc.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
namespace FirstWCFWebService
{
// NOTE: You can use the "Rename" command on the "Refactor"
menu to change the class name "FirstWebServices" in code, svc and
config file together.
// NOTE: In order to launch WCF Test Client for testing this
service, please select FirstWebServices.svc or
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
namespace Client.Controllers
{
public class HomeController : Controller
{
FirstWebServicesClient client = new
FirstWebServicesClient();
public ActionResult Index()
{
ViewBag.Message=client.Message();
return View();
return View();
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12
return View();
}
}
}
Index.cshtml
@{
ViewBag.Title = "Home Page";
}
<h1>@ViewBag.Message</h1>
SHAGUN DEOGHARKAR
FYMCA , ROLL NO 12