0% found this document useful (0 votes)
10 views9 pages

DNTP 1

.net practical 1

Uploaded by

Dhruv Khant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views9 pages

DNTP 1

.net practical 1

Uploaded by

Dhruv Khant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

FACULTY OF ENGINEERING AND TECHNOLOGY

Department of Computer Engineering


01CE0523 - .NET Technologies

.NET TECHNOLOGIES
(01CE0523)
Lab Manual
______________________________
Name: Meet Ashwinbhai Patel
Enrolment No: 92310103053
Class: 5TC2
Batch: C
FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

INDEX

Lab Program Date Marks Signature

1. Program on Class, Object and Constructor

2. Program on Inheritance and Interface

3. Program on Polymorphism and Exception Handling

4. Create web application using ASP.Net Web Controls

5. Create web application using ASP.Net Rich Controls

6. Create web application using ASP.Net Validation Controls

7. Program on Session and Cookie

8. Creating web application using MVC

Create web application that performs CRUD operation using


9.
ADO.Net

Create Web application which use Data Controls like


10.
Repeater, DataList, DataGrid

11. Program for Creating and using APIs


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

Experiment 1
AIM: Program on Class, Object and Constructor

Source: File Name with extension

Code:

P1.sin :-
using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace P1

class Student

static void MyMethod(string sname,long enroll_no,string classname)

Console.WriteLine("name : " + sname);

Console.WriteLine("enrollment no : " + enroll_no);

Console.WriteLine("classname : " + classname);

static void Main(string[] args)

Student student = new Student();

MyMethod("Meet Patel", 92310103053, "5TC2");

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |2


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

Output:

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |3


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

Code:

Constructor1.sin :-
using System;

namespace Constructor1

internal class Car

string brand;

int price;

long num;

string color;

static Car()

Console.WriteLine("Static Constructor called\n");

public Car()

num = 92310103053;

public Car(string brand, int price)

this.brand = brand;

this.price = price;

public Car(string color)

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |4


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

this.color = color;

public Car(Car c)

color = c.color;

static void Main(string[] args)

Console.WriteLine("Meet Patel");

new Car();

Car c1 = new Car("BMW", 500000);

Car def = new Car();

Car c = new Car("Red");

Car c2 = new Car(c);

Console.WriteLine("Parameterized Constructor called");

Console.WriteLine("Brand: " + c1.brand);

Console.WriteLine("Price: " + c1.price+"\n");

Console.WriteLine("Default Constructor called");

Console.WriteLine("Default value of enrollment no: " + def.num+"\n");

Console.WriteLine("Copy Constructor called");

Console.WriteLine("Color: " + c.color);

Console.WriteLine("Copied Color: " + c2.color);

Console.ReadLine();

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |5


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

Output:

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |6


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

Code:

Constructor2.sin :-
using System;

namespace constructor2

class A

public static string name;

public static long num;

private A()

Console.WriteLine("Welcome to Private Constructor");

public A(string a, long b)

name = a;

num = b;

internal class Program

static void Main(string[] args)

// A obj1 = new A(); //This line raises error because the constructor
is inaccessible

A obj2 = new A("Meet Patel", 92310103053);

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |7


FACULTY OF ENGINEERING AND TECHNOLOGY
Department of Computer Engineering
01CE0523 - .NET Technologies

Console.WriteLine(A.name + ", " + A.num);

Output:

MEET ASHWINBHAI PATEL (92310103053) BATCH: C |8

You might also like