You are on page 1of 2

ADO .

NET Assignments
The Assignments requires the below tables which are created by you during SQL practice if you havent
created, you have to create now. Refer SQL Tables and Data Document for Table Structure and Data.
Tables Employees and Departments
1) Display all the departments using Command and DataReader
2) Display all the department using Data Adapter and DataSet
3) Complete the below assignment using Queries and Stored procedures with command and
ExecuteNonQuery method. Read the values from the user
a. Insert a new Department Check already a department exists with the department id given
by user, if exists insist for new department id otherwise insert into DB
b. Delete Department - Check department id exists with given input. if exists, delete
department and if doesnt exist display message Department Doesnt exist
c. Update Department - Check department id exists with given input. if exists, update
department and if doesnt exist display message Department Doesnt exist
4) Complete the below assignment using Queries and Stored procedures with DataAdapter and
DataSet. Read the values from the user
a. Insert a new Department Check already a department exists with the department id given
by user, if exists insist for new department id otherwise insert into DB
b. Delete Department - Check department id exists with given input. if exists, delete
department and if doesnt exist display message Department Doesnt exist
c. Update Department - Check department id exists with given input. if exists, update
department and if doesnt exist display message Department Doesnt exist
5) Complete the below assignment using DataRelation
a. Display Department ID, Department Name and Manager Name of Department
b. Display Manager ID and Employee Names under that Manager
c. Display Manager ID and Count of Employee under the Manager
d. Display Manager name, Count of Employees and Employee Names under that Manager
e. Display Department ID, Department Name and Count of Employees in that Department
6) Complete the below assignment using DataView
a. Display the Employees Present in specific department. Read Department id from user
b. Sort the Employees according to the specific column name and display. Read Column Name
and Sort Order from user
c. Display Employees whose salary is greater than 5000 and works for Department 30
d. Display Employees work under specific Manager ID. Read Manager ID from user

www.gideeducation.com

Page 1

ADO .NET Assignments


7) Write a program to display the question and options from db one by one and to take the user
answer. At the end display total marks scored out of total marks.
Output of above should be as follows.
Do you want to take the exam (y/n)?
If the input is n, exit from the from program
If the input is y, output should be as follows
Q1. Which is not a loop?
a. While
b. For
c. Switch
d. Foreach
Enter the answer:
Once the user enters the answer clear the console screen using Console.Clear() Method and display
second question
Q2. Which is not a datatype?
a.
b.
c.
d.

Int
Sint
Long
Decimal

Enter the answer:


Like above, display the one question at time and take the user answer, once the user enter the
answer clear the console screen and display the next question, continue the same till last question.
Once all the questions are completed display the total marks gained like
Total marks out of (need to print no. of questions) are (gained marks).
Result: Pass/Fail ( pass percentage is 70%)

www.gideeducation.com

Page 2