Dot Net
Dot Net
Question Bank
Subject : DotNet Programming, MCA, 3rd Semester
5. Is it possible to get the array index using the for each loop?
}
33. Find out output of the following method.
static void Main(string[] args)
{
int[] arr = { 55, 44, 33, 22, 11 };
Array.Sort(arr);
for (int i = 0; i < arr.Length; ++i)
++arr[i];
foreach (int value in arr)
Console.WriteLine(value);
2. Can override of a same method be possible in the derive class? Explain with an example.
5. What’s the role of the access modifier in C#? Explain with examples.
6. Name the different ways in which you can pass parameters to a method in C#.Explain
with examples.
9. What are the constructors? How do we pass value for child class constructor in C#.Net.?
12. What is the difference between constant and readonly in C#? Explain with an example.
13. What are partial classes in C#? Why do we need partial classes?
15. Differentiate between Run-Time Error and Logical Error with examples.
16. What are types of loops are available in C#.Net. Describe each loop with an example.
18. What are all the different methods under SqlCommand class?
30. What are differences between value and reference types in C#.Net?
34. How do we create a MDI parent form in C#.Net? Explain with an example.
2. Write a method “AddDepartment()” which takes a parameter DName as string and return
Boolean value.
a. It will return true after successfully adding a new department in Department Table,
In any other cases, It will return false;
Assume : Server Name :MyServer, Database : Payroll, User and Password : payroll and
Table : Department has two attributes Did and DName, and Did is autogenerated field.
3. What are built-in controls in Windows Form? Write 10 difference built-in control names
and its uses.
4. What is Page.PostBack event? Explain with an example.
5. Write a program in C# to reverse a string.
6. Write a program to convert 2-D Array into 1-D Array.
7. Write a console program in C# to find first 10 terms of the following series and to print 2
terms per line.
1,1,
2,3,
5,8
8. Write a web form program (LoginForm.aspx) to validate UserId and Password.
9. Write a console program in C# to find out last date of an input date.
10. Write a C# Sharp program that compares two dates.
11. Write a program in C# Sharp to display the individual digits of a given number.
12. Write a C# Sharp program that takes userid and password as input (string type). After 3
unsuccessful attempts, the user will be rejected.
13. Write a program to accept 10 integers to an array and perform the below actions
1) Print the elements in ascending order.
2) Find the min value, max value entered.
3) Print the sum first and second elements in the array
iii.Calculate the HRA (15% of Basic Salary), DA (10% of Basic Salary, Gross
Pay (Basic Salary + HRA+DA), Tax (8% of Gross Pay) and Net Pay (Gross Pay -
Tax).
15. Write a method GetLastEmpNo(), which will return last EmpNo+1 as long using
ExecuteScalar() method.
16. Write a method IsExistEmployee() which take a parameter empno as long and return
boolean value.
i. It will return true if empno is already exist. In any other cases, it will return false.
17. Write a method PoulateEmployee(), which will display detail of employees in
GridView1.
18. What are differences between Array and Arraylist? Explain with examples.
19. Write a console program to merge two 1-D array with same size and find out sum of all
elements of new array.
20. Write a console program to add 10 random numbers between 10 and 100 in List Object
and print the List.