DOT NET INTERVIEW QUESTIONS



14. When Page_render will be fired? What kind of code we can place in that event?

Occurs when the server control is about to render to its containing Page control. This event is used to perform any updates before the server control is rendered to the page. Any changes in the view state of the server control can be saved during this event.

15. What is the difference between user control and custom control?

User control is local to an application while custom control is global to a set of applications. User control is not a compiled code while custom control is compiled code.

16. How can we use or register user control? When can we go for a user control?

User control can be registered using <%@ Register %> directive. We go for a user control when we need the same functionality in multiple web pages of a web site.

17. What is the namespace for creating a dataset?

System.Data


18. What is the namespace for creating a Webpage?

System.Web.UI

19. What is the namespace for your provider?

SQL SERVER : System.Data.SqlClient
ORACLE : System.Data.OracleClient

20. Have you worked with Webservices? When can we go for a webservice ? What is the namespace for creating a webservice?

We go for web service when we have to make business to business communication where both are using different platforms like .net and java. Namespace for creating web service is System.Web.Services

21. Performance wise which one is better? Webservice or remoting?

Remoting.

22. What is authorization and authentication? What are the different authentication modes?

Authentication is identity of a particular user and authorization is validating the user. Different authentication modes are windows, forms and passport.

23. Which authentication are you using in your project? Why? Can you explain different authentication modes?

We are using forms authentication mode. This mode is used to provide access to the web pages by accepting user id and password by creating a web form. Because forms authentication provides security based on registered users of the web site, which is not possible with windows authentication.

24. How can we read an xml file? What are the different ways? Have you worked with xpath navigator? How to use it?



25. Can you read particular element of an xml file?

Yes. We can.


26. In the following xml file what are the syntax errors?





1. Closing tag of category must be
and not
2. Closing tag of Ele1 must be
but not

27. How can we do error handling?
We can do error handling using try catch statements.
Try
{
}
Catch(excetiontype exception)
{
}
Finally
{
}

28. Write some code with error handling?
Static void Main()
{
Int A,B,C;
Console.WriteLine(“Enter Two Integers”);
A=int.Parse(Console.ReadLine());
B=int.Parse(Console.ReadLine());
Try
{
C=A/B;
Console.WriteLine(“Ratio of {0} And {1} Is {2}”,A,B,C);
}
Catch(DivideByZeroException Ex)
{
Console.WriteLine(“Division With Zero Not Possible”);
}
}
29. What is the significance of finally block?
Finally block is used to write the code that needs to be executed both when an exception was raised and no exception was raised.


30. How can we make a private variable as public?


31. What is a sealed class?

Sealed class is a class that can not be inherited.

32. What are OOPs concepts?

1. Class
2. Object
3. Encapsulation
4. Abstraction
5. Polymorphism
6. Inheritance

33. What is the difference between Overriding and Overridable?

Overriding is the concept of creating a method in the derived class with same signature as a method in the base class. Overridable is the key word used in vb.net to specify that the derived class can override the method of the base class.

34. What is the purpose of Virtual?

Virtual key word is used to declare a method in the base class to allow the derived class to override that method.

35. How do you display your application?

36. What is the architecture of your project?

37. Can you write some code to create an interface?

Public interface MyInterface
{
Int sum(int x,int y);
Int Reverse(int n);
}

38. What is type casting?

Type casting is converting one type of variable to another type.

39. How can we convert int variable to string?

By calling ToString() method for the int variable.

40. What is serialization?

Converting the Binary format data to XML format is called as serialization.

41. What is boxing?

Converting Value type to reference type is called as boxing.



42. What is a delegate?

A delegate is a user defined type that is similar to function pointer in C++. Delegate can be used to store address of methods and to create events.

43. What are the different types of ASP.NET controls?

1. Intrincic Controls
2. Rich Controls
3. Validation Controls
4. List Controls

44. What are the different validation controls?

1. Required Field Validator
2. Range Validator
3. Compare Validator
4. Regular Expression Validator
5. Custom Validator
6. Validation Summary

45. What are the different controls that you have used in your project?

46. What are the different template types in Data Grid?

1. Edit Item Template
2. Item Template
3. Header Template
4. Footer Template

47. I want place a check box in grid? Where I need to write code (In which event?)

In Pre render event of the page.

48. How can we populate data into a dataset?

By calling Fill() method of Data Adapter.

49. How many data adaptors are required for populating 10 tables data into a dataset?

10 Data Adapters




50. What is the difference between dataview and datareader?

Dataview is used to provide a view of data available in dataset. Data view can be used to sort the records, filter the records and to find records. Through data view we can also perform insertion and deletion.

Datareader is used to get rows data from the database like dataset. But datareader is readonly. Within the datareader it is not possible to perform insert and delete operations and we can navigate only to the next record.

51. What are the different execute methods of SQLCommand object?

1. ExecuteNonQuery() : used to execute a query that doesn’t return any rows.
2. ExecuteScalar() : used to execute a query and get the value of first column of the first row
returned.
3. ExecuteReader() : used to execute a select statement and return the rows in the form of a
datareader.

52. What are different ADO.NET Objects?

1. Connection
2. Data Adapter
3. Command Builder
4. Command
5. Data Reader
6. Data Set
7. Data Table
8. Data Row
9. Data Column


53. What is caching? What are the different types of caching?

Caching is the concept of storing frequently used data into temporary memory for faster access. Caching is three types.
1. Output Caching
2. Fragment Caching
3. Data Caching.

54. What type of data we need to store in caching and what in session?

We can store any type of data in caching. But in general caching is used to store data retrieved from database. Session is used to store the data to be accessed between pages.


55. What are the different ways of passing data from one page to other page?

1. Session
2. Query String Parameters
3. Cookies


56. What is the difference between GET and POST?

GET will arrange the data within HTTP Header by appending to the URL in the form of query string and will not provide security to the data.
POST will arrange the data within HTTP message body and this will not be visible to the user and will provide security to the data.

57. What is the difference between server.transfer and response.redirect?

Server,Transfer is used when we have to navigate from one page to another page in the same web site.
Response.Redirect is used to navigate from one page to another page in different website.