Browse by Tags
All Tags »
C# (
RSS)
Consider the following class public class Person { public string FirstName { get ; set ; } private string LastName { get ; set ; } protected string Email { get ; set ; } public int Age { get ; set ; } virtual public void showName() { Console .WriteLine...
Sometimes we have to create generic dictionary from the values in datatable. Usually we will loop through all the rows in the datatable and add the relevant keys to dictionary object for ( int _iExRowCnt = 0; _iExRowCnt < dsReturn.Tables[0].Rows.Count;...
Anonymous types are used to define strong types without defining the type. Anonymous types are strongly typed and checked at compile time. It provides a convenient way to encapsulate a set of read-only properties into a single object without having to...
Why do we need LINQ? Most of us would have wrote code to access data from different data sources a database, in memory objects , XML files or from other formats. We have different guidelines, architectures and methods to process and retrieve these data...
Most of us would have encountered these questions What is the difference between constant and readonly fields? When to use constant and when to use readonly fields? What is the advantage/disadvantage of each? Constants In C# you can declare a constant...
Normally to return top N rows we use an SQL statement similar to the one below Select top N * from table but How can we achieve the same thing in DataTable I have seen many examples, using different methods. Most of the methods centered around the idea...
More Posts