Featured
-
How to enable CORS (Cross-Origin Requests) in ASP.NET Web API
There are certain steps that need to be followed f
by gaurav.gautam -
Why does my CHM have a blank content pane?
Hello Readers, Many times I have heard that, many
by Chetan.Sharda -
How to connect to icloud calendar?
Hello coder's world, To connect to icloud calen
by govind.chauhan -
Working with List in Provider Hosted App for Sharepoint
Sharepoint List in Provider Hosted App This Blo
by shubham.mamgain -
REST attributes of WCF Service
Objective: In this article we will explain what a
by govind.chauhan
Tags
Authentication vs Authorization in ASP.NET
Authentication
Authentication is the process to verify user identity by using user credentials. It is a process that checks whether the user is valid or not also this process permits authenticated user to access the resource. A resource can be a...
Best practices for .Net assembly versioning
Hi Friends,
Assembly versioning is something which doesn’t require superfine logic but it does require a great care. Versioning enables us to identify assemblies deployed and helps in troubleshooting in that exact version.
When looked...
Query timeout explained in Asp.net
QueryTimeout Expired is the Error in the asp.net. Users usually get an exception in their application
“The timeout period elapsed prior to completion of the operation or the server is not responding”
When we work with the databa...
.Net best practices for timezone
Hello Readers,
When the system/web application is not used just in a single location, the developer will have to deal with many times zones in the system/application. There are few rules that every developer should keep in mind while dealing w...
Ado.Net : Best practices for C# programmers
Hi Friends,
All of us use ADO.Net one or another way while writing code for database connectivity. In .Net whether you are using your custom classes for data connectivity or using ORMs(Entity Framework) or Enterprise Library, you are using ADO...
Multidimensional Array in C#
An array is the collection of homogeneous elements which stored in a contiguous memory location by using the same variable name. Elements of an array are accessed by their index value. Array index start with 0 and go up-to-the length of an array ...
ASP.NET : Binding ArrayList to Repeater in C#
Binding ArrayList to Repeater in C#
The repeater is a web server data-bound control which repeats a list of items that are binded to the control. Repeater.DataSource is a property that provides data to Repeater and this data is binde...
How to write byte array to file
In C#, many times we need to write a byte array to file. In this blog, we are going to illustrate how to write the byte array to file by using three methods.
1. By using File.WriteAllBytes(string , byte[] ) Method
...
How to implement zip compression in .Net ?
Hi Friends,
Sometimes we need to compress some files programmatically in our code particularly in the case when you are developing any multiple download scenario. We compress the files for following reasons:
1-Compressed files are smaller i...
.Net 4.5 : Json parser
Json.Net is a popular high-performance JSON framework for .NET
Features of Json.NET :
1. It provide JSON serializer for converting between .NET objects and JSON
2. It supports Binary JSON,XML to JSON, JSON to XML, LIN...
How to use Automapper in .NET ?
Hi Friends,
Before knowing about "How to use Automapper" we should know what mapping is and then we'll see how to make it "automatic". So I am taking here an ASP.NET MVC example to make things easier and understandable....
Difference between Interface and Abstract class
Interface
Interface looks similar to a class, but it does not contain implementation. They may contain declarations of events, indexers, methods and properties.
With Interfaces, it is easier to achieve plug-n-play like a...
How to uninstall .Net framework ?
Hi Friends,
.Net framework makes our life easier by providing multiple assemblies for development of applications. All good here except when it gets corrupted because of some file missing or due to some other programs interfering with it. So t...
How to execute stored procedure?
Stored Procedure is already written queries which are saved in database. If you want to use any SELECT, INSERT, UPDATE, DELETE query multiple times then you can put your query in stored procedure and use it anywhere. You can execute your stored p...
ASP.NET : Class vs Structure in C#
Class vs Structure in C#
1) Class variables and structure variables are stored in different memory location. Class variables are stored on heap whereas structure variable are stored on stack.
Explanation of how class variabl...
HTTP 404.2 Not Found Error Due to ISAPI & CGI Restriction list settings on the Server
HTTP Error 404.2 - Not Found, The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server
Sometimes, we get Error 404.2 which means that there is no mapping handler found for the reques...
How to debug assembly using .Net reflector?
Hi Friends,
Debugging precompiled assemblies into some meaningful and understandable code is not an easy task without proper tools. Visual Studio ships with a tool named "IL Disassembler" and it does the task for taking a look at the...
How to build Asp.Net website with multi-language?
While creating website in multi-language we have to first understand that what is Localization and Globalization
Localization-Localization is the process of designing web application in such a way such that it can display content in the ...
How to send email in Asp.net
To send an email in c#, we will create an application in which user can login via gmail id and password and send the mails. Now Firstly we will understand what is required to create email application in c#.
If we want to send the email in c# w...
Get Set property in C#
Normally we can declare a datafield and assign value to that datafield, so why do we use GET and SET accessor to return or assign the value of datafield? Let us go through an example to understand GET and SET. A class Employee is having the priva...
How to read XML file
1. XML stands for an Extensible Markup Language.
2. XML is used to store or transport the data.
3. XML stores the information inside the XML tags in an XML file.
We can read a XML file by using following ways:
1. XmlDataDocu...
How to pass an array to stored procedure
Stored procedure is used to store a SET of SQL statements in database as a compiled form which can be used by different programs. It performs a special task like inserting data into database, deleting records from database or updating an existing...
ASP.NET : How to get connection string from Web.config?
How to get connection string from Web.config?
The information required for the communication between application and a particular database is provided by connection string. The connectionString is defined within connectionStrings element...
Binary serialization vs XML serialization in .net
There are many differences between Binary serialization and XML serialization. Some of them are given below:
Binary serialization
XML serialization
1. In Binary serialization, all members...
Best practices Asp.net MVC
There are several points which we have to keep in mind while developing Asp.Net MVC application.
Some of them are given below:
1. Remove unnecessary references- When we create a project there are many references which are added au...
How to get the Connection String from App.config
To get the connection String from App.config, we will proceed as follows:-
1. First we need to add the connection string in App.config file.
Example:
<configuration>
<connectionStrings&g...
DateTime To string format
In C#, we use a method DateTime.ToString(string) to get the value of a DateTime in specific pattern of string.
Syntax:-
public string ToString( string format )
It accepts one parameter "format" which specifi...
Customizing validation error messages in ASP.NET MVC
Hi all,
In the following blog, I'll try to show how to customize validation messages in ASP.NET MVC application. In MVC application, while implementing both client side and server side validation, we usually came across default way of show...
ASP.NET: How to use SelectedIndexChanged with DropDownList ?
ASP.NET: How to use SelectedIndexChanged with DropDownList?
SelectedIndexChanged is an event which is fired whenever selected item changes in web server controls like DropDownList, Combobox etc. To handle SelectedIndexChanged event a correspon...
How to deploy ASP.NET application in IIS
To deploy ASP.NET application in IIS follow the below steps:
1. Firstly, we need to check whether all IIS related components are installed or not.
2. For ensuring this we need go to Control Panel and Click on Programs th...
Convert byte array to hexadecimal string
To convert a byte array to hexadecimal string we use a following two methods:
Method 1:
In first method we use a BitConverter.ToString( Byte[] )
This method convert the define array of bytes to the hexadecimal string format.
...
How to Export Gridview to excel
In C#.net, GridView is use to display tabular data. With GridView it is not mandatory to specify column mappings. If not specified it automatically reads the column name from the data-table to which it is bound. However we must ensure that we spe...
QueryString explained with example in ASP.NET
QueryString explained with example in ASP.NET
QueryString is the property of Request object which is used to pass variable values between html pages or between web forms. It is easier to pass data between web forms through QueryString.
Exam...
Convert ArrayList object to comma separated string
ArrayList is an heterogeneous collection of objects where each object can be indexed individually. While writing an application there could be some scenarios where we have ArrayList object filled with data and we want that data in delimited forma...
Best Practices : Version Control
Irrespective of the technologies used like .Net,Java or PHP software versioning plays a critical role in software development. In this blog we will go through a set of best practices for successful implementation of version control in an organiza...
Guid in C#
Hi friends,
To discuss this topic let's start with some obvious questions and try to answering them with suitable explanation(if needed).
What is Guid in C#?
Guid refers to Global Unique Identifier. It takes 16 bytes space in...
How to read CSV file in asp.net
CSV file contains Comma Separated Values in plain text format. For an example, refer the below screenshot:
To understand this functionality first we will read CSV file by using DataTable and then we will display csv file data in gridview.
...
How to open new window from code behind?
In c#, there are different ways to implement the functionality,Here i am going to explain this functionality in the most easiest way. Let's try to understand and then follow the same in visual studio installed in you...
Best Practices : Asp.Net Application Performance.
Performance tuning of Asp.Net application can be a complex task because multiple components are involved. In the list below we will go through best practices to improve ASP.Net Web application performance.
1) We should disable ViewSt...
How to define a global variable
A global variable is a variable which is accessible throughout the program until the program is running. Global variables are generally static variables so that the initial values must be expressed as constants, rather than expressions. Global va...
Understanding UpdatePanel control in ASP.NET
Hi friends, this blog is targeting those readers who are keen to know about a very common method of partial updating specific region in asp.net page without reloading the whole page again and again, it is also meant for targeting readers who are ...
How to rename a file
We have two ways by which we can rename our file
1. Move method
2. MoveTo method
1. Move method
Move method move a specified file to a new location.
Syntax:
public static void Move( string sourceFileName, string destinatio...
.Net : Best practices for memory management
In this blog we will discuss about best practices for memory management in .Net framework. Even though the .Net framework has its own garbage collection support still as developers we have to think and write code that minimizes memory wasta...
How to Create folder
To Create a new folder we use a Directory.CreateDirectory() method. This method allows us to create new directories in the specified path only if the specified path is not already exists. It is one of a static method in Directory class because of...
How to find .Net assembly version
Whenever we create a project in visual studio, a file named AssemblyInfo is created by itself which contains the attributes used to define the version of assembly during compilation.
Versioning an assembly helps to identify deployed assemblies...
Date Time : Best Practices
In this blog we will go trough best practices for handling DateTime in .NET applications:
1) We should always use a consistent date format across the application.
2) When accepting user input we need to ensure that user enters date ti...
How to connect to database
We can connect our C# application to data in a SQL Server database by using following ways:
1. First Method
Firstly, we need a connection string to connect to database.This connection string contain the information about the server to which...
How to Convert string to an int?
We can convert the string to an int by using following methods:
1. Convert class
2. Parse method
3. TryParse method
4. A custom method
1.Convert class
This method is used to convert one datatype to another datatype.
Convert...
.Net Boxing and Unboxing explained with example
Boxing
The automatic conversion of value type e.g int,char,float etc to a reference type e.g object is termed as Boxing. In general the value type variables are stored in memory space called stack but whenever there is a boxing process the val...
Different types of cross-site scripting
Cross-Site Scripting(XSS) is a type of attack in which attacker can insert and run the client side script in the web application. It occurs when user does not validate or encode the user inputs and show it in the browser directly. The most common...