Home » Interview Q&A » Archive by categoryC# Interview Questions (Page 2)

Difference between Throw and Throw ex in C#

Difference between Throw and Throw ex in C#
Difference between Throw and Throw ex in C# Hey folks, till day you have read Difference between Var and Dynamic in c#,Difference Between WCF and WebAPI , Difference between String and string in C#, Difference between Nullable<> and ?,Difference between Hashtable and Dictionary,Insert data into Database table using SQLBulkCopy class...
Continue reading

Use of Yield in C#

Use-of-Yield-Keyword-in-C-sharp
Use of Yield in C# Quote from MSDN “The yield keyword signals to the compiler that the method in which it appears is an iterator block. The compiler generates a class to implement the behavior that is expressed in the iterator block. In the iterator block, the yield...
Continue reading

Enumerate Enum C# with Examples

Enumerate-Enum-C#
How to enumerate Enum C# Problem: We have enum declared in our class and we want to enumerate enum. How could we enumerate enum let’s together try to understand. Sometimes we get error message like “Enum is a type but used as a variable”. So how can we overcome...
Continue reading

Difference between Hashtable and Dictionary

difference-between-hashtable-and-dictionary
Difference between Hashtable and Dictionary Hey readers, till day you have read Insert data into Database table using SQLBulkCopy class in C#, Ping in C# , Call method after specific time interval C#, Insert Retrieve images from Database in asp.net LINQ TO SQL, Compare two objects in C# and datakey from GridView RowCommand. Today we will...
Continue reading

Difference between Nullable<> and ?

difference-between-Nullable-questionmark-technothirsty
Difference between Nullable<> and ? Hello friends, till now I have explained regarding different differences between. So I recommend you read all difference betweens. Today I am going to explain you regarding Difference between Nullable<> and ?. Every one is having question which should we use from Nullable<> and...
Continue reading

Difference between String and string in C#

difference-between-String-string-technothirsty
Difference between String and string string is an alias in C# for System.String. So technically, there is no difference. It’s like int vs. System.Int32. Find below code to prove above sentence. [crayon-5c9379cdab663826150852/]   As far as guidelines, I think it’s generally recommended to use string any time you’re...
Continue reading

Run Tasks Parallelly in C#

Run-Task-Parallelly-in-Csharp-social
Run Tasks Parallelly in C# Hello folks today I am going to explain you regarding how could we run tasks parallelly, by using Parallel.Invoke We need to add System.Threading and System.Threading.Tasks namespaces. Below is the code snippet to run tasks parallelly in C#.  I have added two method...
Continue reading

Get Message Info Of SQL Server In C#

GetMessageInfoOfSQLServerInCsharp
Get Message Info Of SQL Server In C# Today I am going to explain you how to get message information of SQL Server in C#.You must have a question,Why this would be helpful to us? Most of us, used to create Stored Procedure in Sql Server database to...
Continue reading

Can this be used within a static method

Can this be used within a static method!!! We can’t use this in static method because keyword ‘this’ returns a reference to the current instance of the class containing it. Static methods (or any static member) do not belong to a particular instance. They exist without creating an...
Continue reading

Constant vs ReadOnly in C#

Constant vs ReadOnly in C#
Constant vs Readonly in C# Constant and Readonly keywords are used to assign fix value to variable through out the application, which could not be changed. Constant in C# Constant field or variable must be assigned at declaration time and after that it would not be changed or modified....
Continue reading




DISCLAIMER:
The content is copyrighted to technothirsty.com and may not be reproduced on other websites without permission from the owner.You may contact us using the information below.