Skip to main content

Posts

Showing posts from March, 2017

MVC Interview Questions for Experience Candidates #JustSharing

What is MVC (Model view controller)?
Explain MVC application life cycle?
Is MVC suitable for both Windows and web applications?
What are the benefits of using MVC?
Is MVC different from a three layered architecture?
What is the latest version of MVC?
What is the difference between each version of MVC 2, 3 , 4, 5 and 6?
What are HTML helpers in MVC?
What is the difference between “HTML.TextBox” vs “HTML.TextBoxFor”?
What is routing in MVC?
Where is the route mapping code written?
Can we map multiple URLs to the same action?
Explain attribute based routing in MVC?
What is the advantage of defining route structures in the code?
How can we navigate from one view to other view using a hyperlink?
How can we restrict MVC actions to be invoked only by GET or POST?
How can we maintain sessions in MVC?
What is the difference between tempdata, viewdata, and viewbag?
What is difference between TempData and ViewData ?
Does “TempData” preserve data in the next request also?
What is the use of Keep…

How To Create The Data Adapter Object Using ADO.NET by #RathrolaPremKumar

By reading this article, you will learn key points in ADO.NET, as given below. What is Data Adapter?Primary Data Adapters for the databases.Data Adapter properties.Methods used by Data Adapter.How to create Data Adapter with an example? Let’s start our demo with a Data Adapter introduction. Actually, we use Data Adapter object to establish the connection to the data source and manage the movement of date to and from the database. What is Data Adapter? A data adapter aobject serves as a bridge between a data set object and Data Source such as a database to retrieve and save the data. Data adapter contains a set of database commands and a database connection, which we use to fill a dataset object and update the Data Source. Primary data adapters for databases? .NET makes two primary data adapters available for use with the databases. Other data adapters can also be integrated with Visual Studio .NET. Primary Data Adapters are mentioned below. OleDbData Adapter, which is suitable for use wi…

How To Create And Use Enumeration Types In C#

After reading this blog, you will learn the below points, What is EnumerationAdvantagesSyntax with examples


What is Enumeration? Enumerations type specifies a group of named numeric constants; it is a user defined type, which means we can create an enumeration type, declare variable to that type and then assign values to those variables. Main purpose of using enumeration is to represent constant values. Advantages Makes our code easier to maintain by ensuring our variables are assigned only anticipated values.We can assign identifiable names to the values.Allows us to specify a set of constant values and define a type that will accept values from only that set.When we assign enumeration values, Microsoft intellisense displays a list of possible values that we can use. Syntax with Example We can create enumeration type by using enum keyword, assigning a name and then listing the values that our enumeration can take. Eg
enum Planet {      Mercury,      Venus,      Earth,      Mars  }  
Above …

How To Organize Classes Using Namespaces by #RathrolaPremKumar

Today, in this article, we shall see what does namespace actually do and how to organize the classes using namespaces.




At the end of this article, we will have learned the below bullet points.
IntroductionTwo-Tiered NameSpacesCommonly used namespaces in .NET Framework.Examples Let’s begin. Introduction We use namespaces to organize classes into a logically related hierarchy. Namespaces function as both, an internal system for organizing our application and an external way to avoid name collision between source code and application. Because more than one companies may create a class with the same name, such as Employee, when we create code, that may be seen or used by third parties. It’s highly recommended that we shall organize our classes by using a hierarchy of namespaces. By practising this, we can avoid interoperability issues on application. To create a namespace, we simply type a keyword namespace followed by the name. It is recommended to use Pascal case for namespaces. It is also…

Get Count Of A Substring In A String Without Using Loops

Here we will see how a string occurrence can be counted without using loops. Let's start with a sample string:

string s ="Rathrola Prem Kumar";

Now, we would try and find the count of "the" used in this string without any loops. In order to do that, we will use the following reference: System.Text.RegularExpressions
The query for getting count the count is shown below:
int count = Regex.Matches(s.ToUpper(), "Rathrola").Count;   This will give us the count of the occurrence of "the" in the string. Hope it helped Thanks!

Importance of Solid Principles in Real time Scenario by #RathrolaPremKumar

Most of the modern programming languages including C# support objected oriented programming. Features such as encapsulation, inheritance, overloading and polymorphism are code level features. Using these features is just one part of the story.
Equally important is to apply some object oriented design principles while writing your C# code. SOLID principles is a set of five such principles--namely Single Responsibility Principle, Open/Closed Principle, Liskov Substitution Principle, Interface Segregation Principle and Dependency Inversion Principle. Applying these time proven principles make your code structured, neat and easy to maintain. 
In this article we shall discusses SOLID principles and also illustrates how they can be applied to your C# code

What is Solid? SOLID is an acronym for five principles of architecture. S – Single Responsibility Principle O – Open Close Principle L – Liskov Substitution Principle I –Interface Segregation Principle D – Dependency Inversion Principle Single Respo…