Oracle Asp.Net C# interview Questions for freshers
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.What is the difference between methods – “System.Array.Clone()” and “System.Array.CopyTo()” in C# ?
A. “CopyTo()” method can be used to copy the elements of one array to other.
“Clone()” method is used to create a new array to contain all the elements which are in the original array.
Q. How we can sort the array elements in descending order in C#?
A. “Sort()” method is used with “Reverse()” to sort the array in descending order.
Q. Explain circular reference in C#?
A. This is a situation where in, multiple resources are dependent on each other and this causes a lock condition and this makes the resource to be unused.
Q. List out some of the exceptions in C# ?
A. Below are some of the exceptions in C#
DivideByZeroException
IndexOutOfRangeException
NullReferenceException
ArgumentNullException
InvalidOperationException
StackOverflowException etc
Q. What you mean by delegate in C#?
A. Delegates are type safe pointers unlike function pointers as in C++.
Delegate is used to represent the reference of the methods of some return type and parameters.