Joining two generic lists in linq is tricky, in this article we will see how we can join two lists by using inner join and then by using outer join. Using inner join is quite similar to sql inner join but outer join is a little different, so we will see it with example code as well as records (output). So let's check the data, two generic lists which we will use in our example List1:... On 25 Sep 2013 Viewed: 39,590
How to send email in a new thread in asp.net by using Gmail account or any other account or you can say a page where we can test out all the settings like SMTP Server, Email From, Email To, Email Password, Port Number, Email DeliveryMethod or Secure Socket etc. In this article we will see how to send email in background thread with CCed and BCCed functionality. Here is the page... On 13 Sep 2013 Viewed: 38,228
In my early day career in many interviews I asked same question, what is overloading and overriding so decided to write this small article which may help someone. We will see here in detail about the overloading, overriding and then differences between them. --- **Overloading:** --- is the mechanism to have more than one method with same name but with different signature (parameters). A... On 31 Mar 2013 Viewed: 34,626
We will do insert, update and delete functionality in a GridView with modal popup, we will proceed step by step to learn how easily we can complete this functionality in any project. We will try to create a basic user page where you can see all the users in a grid with paging and buttons to add new user, update an existing user and delete any existing user with confirmation box. We will always... On 01 Sep 2013 Viewed: 24,684
We can use JavaScript to get parent element or jQuery to get parent element but which one would be best for you is up to your need and familiarity with JavaScript and jQuery. In this article we will take different conditions and examples to show how jquery finds parent element and same case with JavaScript. First we will see the simplest form of parent of any element... On 06 Apr 2013 Viewed: 10,628Upload multiple image in multiple size with progress bar in asp.net
In asp.net there is not control to select multiple files and upload them once with progress bar, so we will use a small third party DLL to achieve this functionality. We will use Flajaxian FileUploader, you can download it from [http://www.flajaxian.com][1] We will create three different images of size 100X100, 400X400 and original file, you can say thumbnail, medium size image and original... On 12 Jul 2012 Viewed: 6,558Change column name and data type in Sql Server
How to change column name and data type of a column cannot be done in one statement but first we need to change the column name and then data type, In this post we will check many other things like how to change data type of a column, how to drop a column, how to add a new column, how to make a column not nullable etc. So first we will see how to change a column name as well as data type of... On 05 May 2013 Viewed: 6,174Ajax fill country state and city without postback in asp.net
Country will be filled on page load and once user will select any country we will fill states from that country and again when user will change state we will fill city for that state without postback ( asynchronously) with the help of update panel in asp.net. Create three methods to fetch country, state by country and city by state CountryRepository.FetchCountries(); to fetch country... On 04 May 2013 Viewed: 6,169Linq dynamic order by a list with example
Sort a list dynamically is easy, in this article we will create a class to sort the source dynamically by passing source, column and sort order. Let’s write our class and then we will see it with example, create a new class DynamicSort public static class DynamicSort { public static IQueryableOrderBy (this IQueryable source , string columnName, bool... On 07 Sep 2013 Viewed: 5,624 enum in C# and conversion
An enumeration type (also known an enumeration or an enum) provides an efficient way to define a set of named integral constants that may be assigned to a variable to make programming clear, understandable and manageable. There are ways of using, like how to use enum in switch and case statement, how to convert a text to enum or number to enum to compare, we will discuss here all these points in... On 27 Mar 2013 Viewed: 4,571Polymorphism in C# with example
Polymorphism is derived from two Latin words, 1. Poly means many 2. Marphose means forms. By using inheritance, a class can be used as many types, say we have a Person which may be a Professor, may be a Student, may be Clerk. So in this article we will see some example of Polymorphism. When we derive a class from base class it inherits all the method, properties, fields and events of the base... On 01 Jun 2013 Viewed: 4,565How to create a single thanks page for entire controller in MVC
Sometimes we need a thanks page say we have user registration, change password, activate account functionality in our application then we need a thanks page after registering with our site, to say thanks for registering with us or showing confirmation that your password is successfully changed or your account is successfully activated. So do you think we need three different view for these... On 30 Jun 2013 Viewed: 3,771ASP.Net page life cycle events, orders and purpose
ASP.NET Page Life Cycle order and events Page life cycle is very important concept to understand while working with asp.net, what are the stages we can read the view state values and what is the last event where can write back our view state again. When to load the dynamic controls and when to check the values of dynamically added controls, It is impossible to work without knowing the basics of... On 24 Jan 2015 Viewed: 3,539Convert image to base 64 string and base 64 string to image in c#
Converting and image to base 64 from an image or from a path or converting a base 64 string to an image is quite easy. We will use MemoryStream to convert them. We will use two simple method one to convert the image to base 64 string and other to convert the base 64 string to image. Image can be saved wherever you want or show them anywhere on the page Code to convert the image into base 64... On 01 Jan 2015 Viewed: 3,503SQL ISNULL, IFNULL and NVL function with example
ISNULL in Sql Server is uded to check and return alternate value if value is NULL, while to only check the NULL value, we can us IS NULL with space, in MySQL and Sqlite, for same functionality, we can be use IFNULL and in Oracle we can use NVL. Suppose we want to return 0 if column value is null then we can use select ISNULL(columnName, 0) from table_name Column type and alternate... On 31 Aug 2013 Viewed: 3,157Method overloading in C# with example
Method overloading means having different methods with same name but with different types of parameters or number of parameters also known as static polymorphism. In this article we will try to understand what is method overloading and how we can overload a method with example. Suppose we have a class Calculate which can have a method Add by using two integers, two double, any number of... On 19 Jul 2013 Viewed: 3,143Social media sharing buttons without javascript
Social Media Sharing Buttons Without JavaScript I was looking for code to add social media buttons to share my blog on different sites like facebook, twitter, google plus, tumbler and email, I search many websites but could not found any good article which can help to add these buttons without using JavaScript. Finally I checked the code of different sites and try to copy the rendered code and... On 29 Dec 2014 Viewed: 2,846Get only date or time from a datetime column in sql server
In Sql Server we use DateTime column but in many cases we need to get either only date or only time. So we will see different ways to get these values according to our requirements. If you are using SQL Server 2008 or newer version then luckily we have two types Date and Time Let’s see this in action with Sql Server 2008 (it will not work in older version of SQL) SELECT Getdate()... On 07 Sep 2013 Viewed: 2,585Use XSLT to create menu from database
In some situations we need to create website menu from database, say our application have ability to create pages so that must also need to have a menu item to go to that page. So how to create menu with all those nice CSS and other settings, I think XSLT is best to use in these situations. Let’s see what we would need to create our menu 1. Procedure to get data from database in xml... On 16 Mar 2013 Viewed: 1,876update multiple table with transaction between try catch in sql server
I need to create script for entire database changes every week for my client to run on production server, when I was creating the script I need to check whatever I have created so I try to use transaction and to roll back every change, so I used try catch but it inserted many records in some master tables while there was some error in script and still error was not catching by try catch where i... On 11 Oct 2013 Viewed: 1,64012