Beginning .Net

Get Very useful articles regarding Beginning .Net. This articles are very useful for .Net Beginners.

Wednesday, 2 July 2014

.Net Tips : Remove leading and trailing white spaces from string using Regex with C#.Net and VB.Net example

It is very easy to remove string's leading and trailing white spaces using Regex. Read More...

Wednesday, 25 June 2014

Remove only trailing white spaces from string using Regex with C#.Net and VB.Net example

It is very easy to remove string's trailing white space using regex. Here is example for this. Read More...

Wednesday, 18 June 2014

Remove only leading white spaces from string using Regex with C#.Net and VB.Net example

It is very easy to remove string's leading white space using regex. Here is example for this. Read More...

Wednesday, 12 February 2014

.Net Tips : Convert DataTable object to list of class object using LINQ with C#.Net and VB.Net example

You can fill List of object from DataTable using LINQ. Here is example on this. Read More...

Wednesday, 11 December 2013


Saturday, 29 June 2013

Factory Method Design Pattern In ASP.Net With C# and VB.Net Example

Factory method design pattern is very useful in software creation. Factory method design pattern is a creational design pattern. Read More...

Tuesday, 18 June 2013

.Net Tips : Create or Generate XML file programmatically using XElement and XAttribute class with C#.Net and VB.Net example

It is very easy to create XML file programmatically using XElement and XAttribute class. Look at here the example. Read More...

Tuesday, 11 June 2013

.Net Tips : Add XML declaration programmatically to a XML document in .Net with C#.Net and VB.Net example

We can add XML declaration to a XML document programmatically and able to create XML document. Read More...

Wednesday, 5 June 2013

.Net Tips : Create XElement or XML from string

We can parse or construct or create XML or XElement from string. Read More...

Wednesday, 8 May 2013

.Net Tips: Convert two dimensional array in to Dictionary object using LINQ With C#.Net and VB.Net Examples

You can convert array in to dictionary object using "ToDictionary" LINQ method. Here is example for this. Read More...

Saturday, 13 April 2013

Convert or Cast from one date format to another date format in ASP.Net With C#.Net and VB.Net Examples

Date time conversion is very easy in ASP.Net. Here is example of date time conversion from one format to another format. Read More...

Saturday, 6 April 2013

Make dropdown list auto complete or searchable or filtering using JQuery with ASP.Net Dropdownlist Control

We can make Auto Complete and some fancy look Dropdownlist using javascript and JQuery plug-in. Here is article for Auto Complete and some fancy look ASP.Net Dropdownlist control. Read More...

Saturday, 16 March 2013

Check that string format date is in specific date format or not and create date time object of string date in ASP.Net With C#.Net and VB.Net Example

You can parse date time with specific predefined date time format without generating conversion errors. Here is code and example for that in ASP.Net. Read More...

Tuesday, 19 February 2013

Image slide show using JQuery With ASP.Net Example

Now a day image slide show is very popular in websites. Earlier we are using Flash for image slide show. But now a days we are using Javascript for making lite weight image slide show. Using JQuery we can make image slide shows with a many variations in slide show. Read More...

Tuesday, 29 January 2013

Lifecycle of an HTTP message in ASP.NET Web API

This Image shows how an HTTP request flows through the Web API pipeline, and how the HTTP response arrive back. It has also shows extensibility points, where we can add custom code or even replace the default behavior entirely. Read More...

Wednesday, 27 February 2013

Get formatted date time string from date time object in asp.net

You can get and display formatted date time in asp.net. We are using .ToString() method of date time object to get formatted date time string. Read More...

Thursday, 7 February 2013

Simple email validation without validation control in ASP.NET 4.5 and HTML 5 in TextBox control

New feature in ASP.Net 4.5. HTML5 introduces new data types which also support by ASP.NET 4.5 textbox control. For email validation you do not require any validation controls. We need to just set property of textbox and input type control. Read More...

Monday, 24 December 2012

Image Overlay Using JQuery Plugin With ASP.Net Example

Using Image overlay we can provide more details regarding image on mouse hover of image. This overlay is common in modern websites. We are using JQuery Image Overlay Plugin. This is a javascript file which you found online as well as we place this javascript in our example so you can download that from our given asp.net example. Read More...

Wednesday, 19 December 2012

Bind Strings List to a Grid View with C# Examples and VB.Net Examples

You can bind list of strings to gird view and display very uniform manner in a very easy way. List may be a generic list of strings. Generic List class is available in "System.Collections.Generic" namespace. We are using "DataSource" property of Grid view to set data source and "DataBind" method to bind data. Read More...

Sunday, 18 November 2012

Validate a DropDownList control using validation control in asp.net

There is a situation in drop down list where first item is "[Select]" and you need to make mandatory selection from drop down list except "[Select]". Means, user must select value from drop down list but did not allow to select first element "[Select]". We can achieve this using required field validator control. Read More...

Wednesday, 7 November 2012

Unable to raise server side click event of button using "onClientClick" in Rad AjaxPanel

There is a situation where you want to put asp button in telerik Rad AjaxPanel and execute some javascript function using "onClientClick" event and base on that javascript function you need to execute server side code Read More...

Monday, 29 October 2012

Create and Handle Custom Exception Class in your application in .Net with C# Examples and VB.Net Examples

There is a situations where you need to create and handle a custom exception for handling runtime’s exception for application-specific exceptions. In this example we provide both C#.Net Example and VB.Net Example. Let's look how this mechanism works. For that we need to create a serializable class that extends the System.Exception class, and ass some constructors and properties to manipulate the data members. Read More...

Friday, 19 October 2012

Retrieve or Get only integer values from mixed values of string array or generic string List using LINQ

This is a situations where you have an string array which contains some string element or values and some integer values and we want to parse that integer values from that List or array and retrieve only integer values. Read More...

Monday, 15 October 2012

Implement IComparable interface to compare objects with C# Examples and VB.Net Examples and Sample

You can compare two object of same class with your predefine rules. You can also say comparison between two objects. You can provide compare custom types with your predefined business rules. This also allow to sort collections of instances of those types. Read More...

Monday, 8 October 2012

Allow only numeric decimal value in textbox using ASP.NET RegularExpressionValidator control

We often get requirement to allow only numeric decimal value in textbox for validation purpose, And also we have to specify number of decimal places. We can use ASP.Net RegularExpressionValidator control for this. Read More...

Thursday, 4 October 2012

Allow only integer value in textbox using ASP.NET RegularExpressionValidator control

For validation purpose in your project at some places you put text boxes that accept only integer value i.e. 1, 20 , 50, 200 etc... Read More...

Monday, 1 October 2012

Implement ICloneable Interface with C# Examples and VB.Net Examples

There is a need where you wan to clone an object for your custom requirement you need to "ICloneable" Interface and Implement Clone() Method, the inbuilt Clone() method does not fulfill custom requirement. Read More...

Friday, 28 September 2012

Set Holidays or Note on particular date in asp calendar control with C# Examples and VB.Net Examples

You can set holidays or note on particular date in calendar control. For that we are using "DayRender" Event of the calendar control. Read More...

Wednesday, 26 September 2012

Select entire month or entire week using selection mode in calendar control with C# Examples and VB.Net Examples

You can select entire week or month in asp.net calendar control and get it's selected dates. You can achieve using SelectionMode property of calendar control. Selection mode property has an enum and it has four selection mode like Day , DayWeek , DayWeekMonth and None. Read More...

Saturday, 22 September 2012

Multiple selection of date in asp.net calendar control with C# Examples and VB.Net Examples

You can select multiple dates in calendar control. There is a no direct way to select multiple dates in calendar control. You need to write some code for that. Read More...

Wednesday, 19 September 2012

Get or Retrieve selected date from calendar control with C# Examples and VB.Net Examples

You can get the selected date from calendar control. There is a "SelectedDate" property of calendar control. This property is get and set property so you can also set date of calendar control. Calender control provided in asp.net. Read More...

Wednesday, 19 September 2012

Display Calendar in asp.net web page

Calendar control is available in asp.net. You can set "asp:Calendar" control on page and set it's various properties. Read More...

Tuesday, 18 September 2012

Simple sticky menu using Javascript and JQuery

Now a days sticky menu is most popular menu in websites. You can generate sticky menu using JQuery and some CSS classes. You are able to working menu in out downloadable samples. In this example we integrate sticky menu into aspx page. Read More...

Saturday, 15 September 2012

Set Alternate Text for Image tag

Alternate text for Image is helpful when certain reason Image is not displayed in browser. If Image is not displayed at that time alternate text is helpful to end user. Read More...

Friday, 14 September 2012

Raise server side event on selection of item in the DropDownList or ComboBox with C# Examples and VB.Net Examples

There is a situation where you want to select an item from drop down list or combo box and raise server side event to do some processing at server side. You can raise or fire server side event on selection of item from drop down list or combo box. Read More...

Thursday, 13 September 2012

Create Custom LINQ Extension Methods in VB.Net

You can create your own custom LINQ extension method in .Net Application. These extension methods are very handy in software development. Creating a LINQ extension method in VB.Net has Different approach than C#.Net . Read More...

Tuesday, 11 September 2012

Binary Deserialization with C# Examples and VB.Net Examples

Binary Deserialization is a reverse process of Binary Serialization. In Binary Deserialization we fetch binary file that generated from Binary Serialization and get back origional object. Read More...

Monday, 10 September 2012

Serialize object and store in file using Binary Serialization with C# Examples and VB.Net Examples

There is a need to serialize object and store into a file, and then deserialize when required. For Binary Serialization we are using "BinaryFormatter" class which is available in "System.Runtime.Serialization.Formatters.Binary" namespace. Read More...

Saturday, 8 September 2012

Fill dropdownlist or combobox manually C# Examples and VB.Net Examples

There is a need in website that you want to add items manually in dropdownlist or combobox. You can achieve this using "Items.Add" methods of dropdownlist. Read More...

Friday, 7 September 2012

Beginning .Net , C# Tips : Create Custom LINQ Extension Methods with C# Examples

There is a need to create a custom LINQ extension method in .Net Application. This is a very good .Net Framework feature. These extension methods are very handy in software development. For that we need to create Static Class and Static Methods. Read More...

Thursday, 6 September 2012

Concatenate or Combine LINQ query Results or DataSources with C# Examples and VB.Net Examples

There is a situations where you want to Concatenate Or Combine one or more data sources using LINQ. With the help of the Concat<> extension method to concatenate or combine multiple sources into a single data source. Read More...

Wednesday, 5 September 2012

Populating or Fill dropdownlist from Database table with C# Examples and VB.Net Examples

There are a situations where you want to fill dropdownlist or combobox or listbox from database table. For that you need to get database table records in to DataSet or DataTable and after that you fill dropdownlist from DataTable. Read More...

Tuesday, 4 September 2012

Convert from IEnumerable<> to Dictionary object using LINQ with C# Examples and VB.Net Examples

There is a situations where you need to convert LINQ result or IEnumerable<> object into Dictionary object. This is possible with the help of the LINQ Extension methods. Read More...

Monday, 3 September 2012

Get or Retrieve stored file from SQL Server Database Table with C# Examples and VB.Net Examples

You can retrieve stored file from SQL Server Database Table and store as physical file in hard drive. Read More...

Saturday, 1 September 2012

Beginning .Net : Set Tool Tip for Asp.net Controls

Tool Tip is very useful part of the any application. Tool tips provide more details of particular object on application. Read More...

Monday, 27 August 2012

Parse and create URL with C# Examples and VB.Net Examples

There is always a need to parse and create valid URL. We can achieve this using "Uri" class's "TryCreate" method. Here is example for this. Read More...

Saturday, 25 August 2012

Beginning .Net : make the TextBox disabled in ASP .NET

You can make textbox disabled. Means do not allow enter or change text into textbox. You can do this with the help of "Enabled" property. You need to set Enabled=false to make text box disabled. Read More...

Friday, 24 August 2012

Beginning .Net : Text wrapping into the multi line textbox

There are situation in multi line textbox where you want to wrapping text in textbox and sometimes you not want to wrap text , that text type as it is. We can achieve this using "Wrap" property. By Default it is true. Read More...

Thursday, 23 August 2012

beginning .net : set maximum characters allowed for Single Line and Multi Line Textbox in .Net

There is always a need of application to set maximum length allowed in textbox. In this article we demonstrate both single line textbox and multi line textbox max length validation. There is a different way to set maximum characters allowed for single line textbox and multiline textbox. Read More...

Wednesday, 22 August 2012

Write an Event Entry in Windows Event Log

You can write or insert entry in to the Windows event log using the static methods of the EventLog class, or also you can create an EventLog object. But you must decide in which event source you want to write your log entry.The event source is a string that uniquely identifies your application. Read More...

Monday, 20 August 2012

Hashing algorithms in .Net Framework

Hashing algorithms are one way cryptographic functions that accept plain text of any length and generate a numeric value. These are one-way because it̢۪s almost impossible to get the original plain text from the hash code. Hashing algorithms are useful for encrypt the password. Read More...

Saturday, 18 August 2012

.Net Beginners : Make the TextBox readonly

As a .Net Beginners you must know how to make textbox readonly. You can make textbox read only. Means do not allow type text in textbox and also is there is any text predefined in that you are not able to change that text. You can do this with the help of "ReadOnly" property. Read More...

Friday, 17 August 2012

Handling errors using Custom Errors configuration settings in web.config

When error occurred in .Net application Asp.Net page display it's default error page with the source code and line number of the error. This approach is not good it has some issues like. Read More...

Thursday, 16 August 2012

Object cannot be cast from DBNull to other types Error

This error occurred due to cast or convert or assign NULL value cell of data row or data table.
Error Reason : Here is example for this. We have datatable. This data table contains value of cusutomers, thsi data table has three columns. Read More...

Thursday, 9 August 2012

Read event logs and display with C# Examples and VB.Net Examples

You are able to reading event log from .Net application. We are using "EventLog" class of "System.Diagnostics" namespace. There are three categories of event log available Application, Security and System. Read More...

Wednesday, 8 August 2012

List of server configuration files in .Net

Every ASP.NET server includes a number of configuration files, such as the machine.config , web.config file. This file is installed as a default .NET Framework installation. Read More...

Tuesday, 7 August 2012

Beginning .Net , C# Tips : Get number of processors on the machine

You can get processors count on your machine. We are using "ProcessorCount" property of "System.Environment" class. Read More...

Monday, 6 August 2012

C# Tips : Find or Discover all SQL Server Instances on Local Area Network (LAN)

We can get all SQL server instances of our Local Network (LAN). We are using GetDataSources method of the System.Data.Sql.SqlDataSourceEnumerator class. Read More...

Saturday, 4 August 2012

C# Tips : Union or combine Two LINQ query Results with C# Examples and VB.Net Examples

You can union of two LINQ query or Results. You can also say combine records from two LINQ query or Results. We are using "Union" method of LINQ. In this example we combine or union records from two DataTable using LINQ. Read More...

Friday, 3 August 2012

Beginning .Net : Delete data into SQL Server Database table with C# Examples and VB.Net Examples

You can delete data or records into SQL Server Database tables using SqlCommand Class. You can use "ExecuteNonQuery" method of SqlCommand Class. You can delete all or particular criteria records using where clause. Read More...

Wednesday, 1 August 2012

C# Tips : Get Operating System name and version details of server with C# Examples and VB.Net Examples

You can get Operation System (OS) name and major version and minor version details,service pack and build details of server using "System.Environment" class. We can use OSVersion property of Environment Class which will return "OperatingSystem" class. Read More...

Monday, 30 July 2012

Create a well formed URI using UriBuilder class with C# Examples and VB.Net Examples

You can use System.UriBuilder class to build a new well-formed URI. You can also say create a well-formed URL. You need to set some property of UriBuilder object's , like Scheme , Port , Host , Path etc.... Read More...

Saturday, 28 July 2012

Beginning .Net : Update data into SQL Server Database table with C# Examples and VB.Net Examples

You can update data or records into SQL Server Database tables using SqlCommand Class. You can use "ExecuteNonQuery" method of SqlCommand Class. You can update all or particular criteria records using where clause. Read More...

Friday, 27 July 2012

Get list of all files of directory or folder using LINQ using .Net Framework 4 with C# Examples and VB.Net Examples

You can get list of all files in particular directory or folder and it's all sub directories. .NET Framework 4 allow to enumerate directories and files using methods that returns enumerable collections. Read More...

Thursday, 26 July 2012

Beginning .Net : Insert data into SQL Server Database with C# Examples and VB.Net Examples

You can insert data or records in to SQL Server Database tables using SqlCommand Class. You can use "ExecuteNonQuery" method of SqlCommand Class. This article is very useful for .Net Beginners. Read More...

Tuesday, 24 July 2012

.Net Tip : Intersect or find common records of Two LINQ queries with C# Examples and VB.Net Examples

You can get Intersect of two LINQ query or Results. Intersect means find common records between two LINQ results. Here is example of this. Read More...

Monday, 23 July 2012

.Net Tip , C# Tip : Copy one stream to another stream Using CopyTo Method with C# Examples and VB.Net Examples

.NET Framework 4 introduce new "CopyTo" method of Stream Class of System.IO namespace. Using this method we can copy one stream to another stream of different stream class. Read More...

Saturday, 21 July 2012

Beginning .Net : Specify the width of the TextBox

As a .Net Beginners you must know how to set textbox width. You can set "width" property of TextBox control to set width. You can set "width" property in Pixel or Percentage wise. Read More...

Friday, 20 July 2012

Beginning .Net : Fill DataTable from a DataReader with C# Examples and VB.Net Examples

You can also fill DataTable with DataReader with the help of "Load" method of DataTable. This is very useful for .Net Beginners. We can do this using ExecuteReader method of SqlCommand class. Read More...

Thursday, 19 July 2012

.Net Tip , C# Tip : Create XML File using XmlWriter and save with C# Examples and VB.Net Examples

You can create a XML File using XMLWriter class. XMLWriter class available in System.XML namespace. This will give proper indentation and create Well formed XML File. Read More...

Wednesday, 18 July 2012

Beginning .Net : Fill DataTable from sql query using Data Adapter with C# Examples and VB.Net Examples

This is very useful post for .Net Beginners. Every .Net Developer use this in their application. We can fill data table using SqlDataAdapter by execute sql query. SqlDataAdapter is also use for execute standard INSERT, UPDATE, and DELETE statements.This is an ADO.Net . Read More...

Saturday, 14 July 2012

Beginning .Net : Set focus to a TextBox on web page load

There is a situation where you need to focus on text box after page is loaded. This is the best user friendly concept. You can do this with two ways. First use .Focus() method of TextBox Control. Second use Page.SetFocus method. Read More...

Monday, 9 July 2012

Quiz : Which control is placed on the page for AJAX Functionality ?

Options : A. asp:AjaxManager B. asp:PageManager C. asp:ScriptManager D. asp:ClientScriptManager Read More...

Monday, 9 July 2012

Beginning .Net : Working with DataReader with C# Examples and VB.Net Examples

If you need to process the records one by one or iterate the records from database table for that you need to use IDataReader instance. There are various implementation of IDataReader class. We are using System.Data.SqlClient.SqlDataReader class to iterate the records. Read More...

Saturday, 7 July 2012

Beginning .Net : Submit a page to the server when the TextBox value has changed

You can submit a page when textbox value changed. For that you need to take asp textbox control and set it's AutoPostBack property to true and handle it's ontextchanged event. Read More...

Saturday, 7 July 2012

Beginning .Net : Password textbox in asp.net

You need this password textbox where you would like you insert username and password from website users. With the help of this password textbox inputed password character is not see on textbox , it will display astrik "*" or other special characters. Read More...

Thursday, 5 July 2012

.Net Tips , C# tip : Read and Processing XML file with an Xdocument with C# Examples and VB.Net Examples

XDocument is Introduce in System.Xml.Linq namespace. XDocument is more friendlier and easy to use than XMLDocument. Earlier we are using XMLDocument for read and processing XML File. Syntax of retrieving element from XML document is different than XMLDocument. Read More...

Tuesday, 3 July 2012

.Net Tips : Read XML File With an XMLReader with C# Examples and VB.Net Examples

XmlReader provides fast, forward-only, read-only access to XML documents. These documents may contain various elements in multiple namespaces. XmlTextReader and XmlNodeReader classes derive from XMLReader and work as an abstract class for these classes. Read More...

Wednesday, 27 June 2012

Beginning .Net : How to programmatically set the TextBox value and get the TextBox value with C# Examples and VB.Net Examples ?

You can set and get texbox value programmatically using C# and VB.Net. Every .Net Beginners needs to know this. You can use "Text" property of textbox to set and get value of textbox. Read More...

Monday, 25 June 2012

Beginning .Net: Execute SQL query or Stored Procedure on database in C# .Net Programming and VB.Net Programming

This is very useful article for .Net Beginners Who want to querying database server using programming . You can create a command object appropriate to the type of database that you use. All command objects implement the System.Data.IDbCommand interface. Configure the command object by setting its CommandType and CommandText properties. Execute the command using the ExecuteNonQuery, ExecuteReader, or ExecuteScalar method, depending on the type of command and its expected results. Read More...

Saturday, 23 June 2012

Beginning .Net : Store and Retrieve database connection string in C# .Net Programming and VB.Net Programming

As a .Net beginners you need to know about how and where to store database connection string and how to retrieve this database connection string.
Store database connection string in Web.Config file is a good way.
In Web.Config file there is "<configuration>" section , In this section there is "<connectionStrings>" section. In this section you can add your connection string. You can add connection string using add tag. Read More...

Friday, 22 June 2012

.Net Beginners , C# Tips : Optional and Named Parameters in C#

.Net 4.0 Framework provide Optional and Named Parameters in C# also. Previously it was supported in VB.Net. Now you do not need to write unnecessary overload methods , With the help of the Optional method you can achieve this. Read More...

Thursday, 21 June 2012

C# Tips : Create database connection string using ConnectionStringBuilder

You can create database connection string using ConnectionStringBuilder class. You can use the System.Data.Common.DbConnectionStringBuilder class or one of its strongly typed subclasses that form part of an ADO.NET data provider. Here is the list of available DbConnectionStringBuilder implementations for standard data providers: Read More...

Wednesday, 20 June 2012

How to connect database using C#.Net and VB.Net

You need to open a connection to a database on regular bases for database operations. For that you need to create a connection object. The IDbConnection interface represents a database connection, and each data provider implement interface uniquely. Here is the list of some IDbConnection implementations for standard data providers: Read More...

Tuesday, 19 June 2012

Read file with FileStream using Read method in C# .Net Programming and VB.Net Programming

You can read file byte data using "Read" Method of FileStream class and get bytes array. You can also say that read bytes array from FileStream object or read bytes array from FILE. Here are example of this. Read More...

Tuesday, 19 June 2012

How to Open a filestream for reading a stream using C# .Net Programming and VB.Net Programming

You can open a file in read mode and get FileStream Object for reading a stream. After getting FileStream object you can read data using "Read" and "ReadByte" methods. You can open any file ie Text , Image , doc etc.. After reading the file you need to close the FileStream Object. Read More...

Saturday, 16 June 2012

Read the whole file and return a string of data using C# and VB.Net

There is a very quick way in .Net to read the entire file and return a string of data. We are using ReadAllText method of File class. Here are sample example of this. Read More...

Friday, 15 June 2012

Querying the array using LINQ and Predicat in VB.Net

You can also query the array variables using LINQ. Here are sample example for this. In this example there is an array of integer values which contains various number, Now we want to get numbers in array which is greater then 5. We can do this without FOR loop. Read More...

Thursday, 14 June 2012

Append or Write the data to a text file

There is a very quick way to open text file and appends data into that file. There are two methods to appends text files AppendAllText and AppendAllLines. These methods open a file. Appends data to the files , and then close the file. If file does not exist, These methods create the files , appends the data and close the file. Read More...

Wednesday, 13 June 2012

Compress and Decompress file or data using C# and VB.Net

.Net framework provide the System.IO.Compression.GZipStream or System.IO.Compression.DeflateStream to compress or decompress data. Both GZipStream and DeflateStream classes allow you to use ZIP and Deflate compression algorithms to compress or decompress data. Read More...

Tuesday, 12 June 2012

Locate specific lines within the Text file Using LINQ

You can also query the text file using LINQ . Here are example for this. In this example we can get specific lines which has matching word given by us. After the LINQ query is executed you need to close file otherwise it gives error on next attempt to access of file. Read More...

Monday, 11 June 2012

How to Open a file and return a StreamReader for reading the data

You are able to get stream reader of a file and work on stream reader. After getting Stream Reader and completing work on stream reader you have to close SteramReader using Close method. to avoid any file open errors. Read More...

Saturday, 9 June 2012

Get common values from two arrays using LINQ

Using LINQ you are able to fin common values amoung two arrays. There is a one method "Intersect" in LINQ to get intersect values. Here are sample example for this. Read More...

Friday, 8 June 2012

How to Open a file and return a FileStream

You can get the FileStream of a file by opening a file using File Class. After get FileStream and completing work on file stream you have to close FileSteram using Close method. to avoid any file open errors. Read More...

Wednesday, 6 June 2012

C# Tips : Sort an array using LINQ

Using LINQ you are able to sort array. Array may contains integer , string , double or char values. Here are sample example for this. Read More...

Tuesday, 5 June 2012

Left Outer Join Using LINQ in LINQ To Objects

You can also do left outer join using LINQ. Here are sample example of this. In this example there is book class which has PublisherId field , this fields contains only numeric values. Read More...

Friday, 1 June 2012

"A potentially dangerous Request.Form value was detected from the client" Error Occurred during page postback

Sometimes you get this error when data is post on server from click of button or other postback operations. You got this type of error message: Read More...

Wednesday, 30 May 2012

Querying the XML data file using LINQ in LINQ to XML

Using LINQ to XML we can use the same basic LINQ syntax to query XML documents. LINQ to XML uses System.Xml.Linq namespace. Here are example for this. Read More...

Tuesday, 29 May 2012

Paging Query Using LINQ

Using LINQ we can achive paging logic in your application much easier by exposing the Skip and Take methods. The Skip method enables you to skip a defined number of records in the resultset. The Take method enables you to specify the number of records to return from the resultset. Read More...

Friday, 25 May 2012

Different LINQ operators in LINQ To Objects

LINQ also includes many operators you can execute on enumerable objects. Most of these operators are available to use and are similar to operators that you find in SQL, such as Count, Min, Max, Average, and Sum. Read More...

Wednesday, 23 May 2012

Simple filter query with LINQ To Objects

You always need to filter the records based on certain fileds. Using LINQ query you are able to get this. Here are sample example for that. Read More...

Tuesday, 22 May 2012

Linq delayed execution behavior

An interesting feature of LINQ is its delayed execution behavior. Means that even though you may execute the query statements at a specific point in your code, LINQ is smart enough to delay the actual execution of the query until it is accessed. Read More...

Thursday, 17 May 2012

Get selected fields LINQ query using LINQ To Objects

There are situations where you do not want all fields in LINQ query you want only selected fields. You can also say that Creating a custom projection with LINQ. Read More...

Wednesday, 16 May 2012

Simple query with LINQ To Objects

Now a days LINQ is more popular for query. We can also query to object using LINQ. Here are sample example of select query LINQ To Objects. Read More...

Thursday, 10 May 2012

Simple Screen Scrap using c# and vb.net

Screen scrapping means to get other sites data from given URL. You can do this using the HttpWebRequest and HttpWebResponse classes to screen scrape, you can use the following code to build a Web page that will serve as a simple Web browser. Read More...

Tuesday, 8 May 2012

Fill dropdownlist from Enum

There are a situations where you want to fill dropdownlist of listbox using Enum. Here are sample example for this. Read More...

Monday, 7 May 2012

Make First Letter of each word capital

There is a situation where you need to capital first letter of each word. You can also say that Title Case to string. Here are useful code snippets for this. Read More...

Saturday, 5 May 2012

Encodings in StreamReader

The StreamReader by default attempts to determine the encoding format of the file. If one of the supported encodings such as UTF-8 or UNICODE is detected, it is used. If the encoding is not recognized,the default encoding of UTF-8 is used. Read More...

Friday, 4 May 2012

IO Readers and Writers in .Net

Main parts of I/O in the .NET Framework are Reader and Writer classes. These classes help the reading and writing of individual bytes to and from Streams. The .NET Framework provides a wide variety of reader and writer classes, each designed for reading or writing according to a specific set of rules. Read More...

Thursday, 3 May 2012

Get multiple selected items from listbox using LINQ

If you want to get multiple selected items from listbox without using FOR loop using LINQ you can achieve that. Read More...

Wednesday, 2 May 2012

Convert List of Object's Value to List of Integer in C# Programming

There are many situations where you want to convert List<Object>'s Value to List<int>. Using Linq Method ConvertAll we can achieve in one sentence. LINQ Namespace is System.Linq.  Read More...

Monday, 30 April 2012

Convert List of Integer to List of String

There are many situations where you want to convert List<int> to List<string>. Using Linq Method "ConvertAll" we can achieve in one sentence. LINQ Namespace is System.Linq.  Read More...

Saturday, 28 April 2012

Reading and writing binary data in C# Programming

Now use the BinaryReader and BinaryWriter classes to read and write primitive types to a file.The BinaryWriter writes primitive objects in their native format, so in order to read them using the BinaryReader, you must select the appropriate Read method. Read More...

Friday, 27 April 2012

Reading and writing a text file with a StreamReader in C# Programming

StreamReader and StreamWriter classes to write a string to a text file and then read the contents of that text file. Read More...

Thursday, 26 April 2012

Write To a MemoryStream in C# Programming

There is a situation where you want to write data in Memory Stream. You can write to the stream by encoding a string containing the information you want to write to a byte array and then using the stream̢۪s Write method to write the byte array to the MemoryStreams. Read More...

Wednesday, 25 April 2012

FileStream in .Net

Any type of I/O operation you are performing in .NET, if you want to read or write data you eventually use a stream of some type. Streams are the basic mechanism. .NET uses to transfer data to and from its underlying source, it will be a file, communication pipe, or TCP/IP socket. The Stream class provides the basic functionality to read and write I/O data, but because the Stream class is marked as abstract, you most likely need to use one of the several classes derived from Stream. Each Stream derivation is specialized to make transferring data from a specific source easy. Read More...

Tuesday, 24 April 2012

Read a file using FileStream in C# Programming

There are many times you want to read text file. There are many ways to read files. One way is to use FileStream class. Here are sample example to read the file and display it's content on page. Read More...

Friday, 20 April 2012

New string.IsNullOrWhiteSpace inbuilt methods in .net 4.0

There are situations in which you need to check that string is null or Empty or only space in string exist or not. Previously we have string.IsNullOrEmpty Method. This method only check for Null and Empty, it does not check which spaces. Read More...

Wednesday, 18 April 2012

Working with Path Class using C# Programming

.NET Framework provides you with a class for working with file paths. The System .IO.Path class has many static methods to work with paths. Read More...

Tuesday, 17 April 2012

Set and Get current directory in .Net

When an ASP.NET page is executed, the thread used to execute the code that generates the page by default has a current working directory of that page. Read More...

Monday, 16 April 2012

Get list of files from directory programmatically using .Net

Sometimes we want list of files and its details like file name , size , last access time etc... of a directory programmatically. We can achieve this using DirectoryInfo and FileInfo Class. These classes are available in available in System.IO Namespace. Read More...

Thursday, 12 April 2012

Get Directory Information programmatically using .Net

Some time you want to get directory information like sub directories , last access time , last write time , Create new directory in to parent directory etc... programmatically using .Net. Read More...

Monday, 9 April 2012

Call Overloaded method using reflection

Some time you need to call single or overloaded method using reflection. Here are sample example for that : Read More...

Wednesday, 4 April 2012

Get System Drive info programmatically using .Net

You can get Drive info using DriveInfo class. DriveInfo class available in System.IO Namespace. You can get details like name, type, size, and status etc... of each drive. Read More...

Monday, 2 April 2012

OnClientClickevent and AJAX is not working for telerik RadControls.

IEnumerable is an interface implemented by the System.Collecetion type in .NET that provides the iterator pattern. Read More...

Saturday, 31 March 2012

ASP.Net Configuration file heirarchy levels

Here are details of ASP.Net Configuration file heirarchy levels : Read More...

Friday, 30 March 2012

Apply scrolling to contents in aspx page using DIV Element

By applying style to DIV element we can achieve this. We can use "overflow" property of style. Overflow property has different values like auto , hidden , scroll, visible Read More...

Tuesday, 27 March 2012

How to Enumarate an Enum ?

You can able to enumerate an enum to get it's values and names. Read More...

Tuesday, 20 March 2012

"Thread was being aborted." Error occurred due to Response.End, Response.Redirect, or Server.Transfer method methods

When you are using Response.End, Response.Redirect, or Server.Transfer method methods in Try Catch Block it will throw "ThreadAbortException" Exception. Error Message like "Thread was being aborted." Read More...

Thursday, 1 March 2012

How to insert an item to the specified location in the DropDownList or ListBox?

You can also insert ListItem at specific location. In .Add Method Items are append. There is one method ".Insert" to insert items as specified location. Read More...

Wednesday, 29 February 2012

How to populate DropDownList/ListBox from the datasource?

There is datasource property of DropDownList/ListBox which you need to assign and after that you call DataBind method that will bind the data. Read More...

Tuesday, 28 February 2012

How to specify a default button on the page so that when user hits the Enter key that button gets clicked ?

If you want to set default button page wise , you can use "DefaultButton" Property for Html Form Control. Read More...

Monday, 27 February 2012

How to post a page to another page in ASP.NET?

In Asp.net we can also post data from one page to another page. We can achive this through "PostBackUrl" Property of asp:Button and asp:LinkButton. In "PostBackUrl" Property you can set the path of second page name on which you want to get posted data. Read More...

Saturday, 25 February 2012

How to get virtual path of web application ?

Getting the virtual paths local to server using this syntax. Read More...

Friday, 24 February 2012

How to write HTML text or Encoded text on the web page?

There are many cases when we need to display HTML text as HTML text without applying HTML formatting. Read More...

Thursday, 23 February 2012

How to get the length of the string using javascript?

There is one method "length" to get length of string. Read More...

Thursday, 23 February 2012

How to associate an asp:Label with a TextBox or other Form control?

To associate an asp:Label to From controls means , when clicking on asp:Label cursor focus move to that associate controls. Read More...

Wednesday, 22 February 2012

How to write CSS formatted text on the web page?

There are various properties of Asp:Label control to set CSS formatted. Read More...

Wednesday, 22 February 2012

How to write Text for the asp:Label control?

For write text in asp:Label , set .Text Property of Label. From HTML View you can set like following way. Read More...


No comments:

Post a comment