online Asp.Net C# interview Questions for freshers
Q. What is the file extension of web service in asp.net ?
A. .asmx is the file extension name in web services on asp.net services
Q. What you mean by Filtering of data?
A. Filtering of data is done when you need to display only selective records.
Given below are the two methods for filtering data:
Creating parameterized queries.
Filtering data using control of a window form.
Q. What is the difference between ExecuteScalar and ExecuteNonQuery?
A. ExecuteScalar returns output value where as ExecuteNonQuery does not return any value but the number of rows affected by the query. ExecuteScalar used for fetching a single value and ExecuteNonQuery used to execute Insert and Update statements.
Q. Can we execute multiple catch blocks in C# asp.net application?
A. No. Once any exception is occurred it executes specific exception catch block and the control comes out.
Q. Why to use “finally” block in C#? asp.net applciation?
A. “Finally” block will be executed irrespective of exception. So while executing the code in try block when exception is occurred, control is returned to catch block and at last “finally” block will be executed. So closing connection to database / releasing the file handlers can be kept in “finally” block.
Q. What is the difference between “finalize” and “finally” methods in C# asp.net application?
A. Finalize – This method is used for garbage collection. So before destroying an object this method is called as part of clean up activity.
Finally – This method is used for executing the code irrespective of exception occurred or not.