Using Linq to Objects in C#

by a Guest on October 21, 2010 0 Comments

This tutorial was created with Microsoft Visual Studio .NET 2008.

In this tutorial, we will be looking at using LINQ to Objects. We will be creating a Windows Forms Application that will first define an array of numbers, and then we will use LINQ to Objects to interact with this collection of numbers. We will create buttons to display the results of calculations of the numbers, demonstrating the built-in functions of LINQ, that we can perform on most any collection.

We will start by designing our form with Four buttons and a label. The first button will be to display all the numbers in our array, which we will hard-code for this example. The label will be to show the results of our functions, and then the other three buttons we will use for LINQ functions.

We will also implement a StatusStrip control to make use of the label within ...

read more

How to Keep Linq to Sql Classes in Sync With Database Structure

by a Guest on October 21, 2010 0 Comments

About Linq To Sql

Since it became available developers using .Net have no need to mix code with SQL commands within the application to access database objects. Now developers can access data in databases using programming language they get used to (C#, VB.NET). Moreover, using LINQ To SQL allows developer to uniformly manage all iterative data sources: databases, XML, various collections, etc. In addition you get code verification during compilation, full integration in Visual Studio which provides many advantages: IntelliSense, database model designer, auto generation of code by the model and so on.

Nothing is ideal

And still in spite of all advantages of using LINQ To SQL, its usage in real large projects is complicated for some problems. Using LINQ To SQL in the project will make you use such Visual Studio component as LINQ To SQL Classes. The component is not easy to use as it should ...

read more

LINQ Select Statement Using Anonymous Types in C#

by a Guest on October 21, 2010 0 Comments

public void UpperCaseLowerCase()
{
    string[] words = { "aPPLE", "BlUeBeRrY", "cHeRry" };

    var upperLowerWords =
        from w in words
        select new {Upper = w.ToUpper(), Lower = w.ToLower()};

    foreach (var ul in upperLowerWords) {
        Console.WriteLine("Uppercase: {0}, Lowercase: {1}", ul.Upper, ul.Lower);
    }
}

// Result

Uppercase: APPLE, Lowercase: apple
Uppercase: BLUEBERRY, Lowercase: blueberry
Uppercase: CHERRY, Lowercase: cherry

LINQ Select Statement in C#

by a Guest on October 21, 2010 0 Comments

Example of a LINQ Select statement where the method adds 1 to the number and prints them out:

public void AddOneToValue()
{
    int[] numbers = { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0 };

    var numsPlusOne =
        from n in numbers
        select n + 1;
   
    Console.WriteLine("Numbers + 1:");

    foreach (var i in numsPlusOne)
    {
        Console.WriteLine(i);
    }
}

// Result

Numbers + 1:
6
5
2
4
10
9
7
8
3
1

Nivo Slider is One Awesome jQuery Image Slider

by a Guest on October 3, 2010 0 Comments

Nivo Slider is the most awesome jQuery image slider, manual and auto slide transaction with cool effect. jqFancyTransitions is easy-to-use jQuery plugin for displaying your photos as slideshow with fancy transition effects.

Nivo Slider Home Page

Will Microsoft SQL Server Ever Pass Oracle?

by a Guest on August 16, 2010 0 Comments

Do you think that Microsoft SQL Server will ever pass Oracle?

Page 1 of 1.

Post categories

Post archives