.NET
  Home arrow .NET arrow Beginning LINQ to SQL Using Visual Studio ...
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
.NET

Beginning LINQ to SQL Using Visual Studio 2008
By: Jagadish Chaterjee
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2008-03-31

    Table of Contents:
  • Beginning LINQ to SQL Using Visual Studio 2008
  • Developing a simple LINQ to SQL application (without LINQ designer): UI Design and source in VB.NET
  • Developing a simple LINQ to SQL application (without LINQ designer): source in C#
  • CRUD operations using the LINQ to SQL application (without LINQ designer): UI Design
  • CRUD operations using the LINQ to SQL application (without LINQ designer): Source in VB.NET
  • CRUD operations using the LINQ to SQL application (without LINQ designer): Source in C#

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Beginning LINQ to SQL Using Visual Studio 2008
    (Page 1 of 6 )

    This is an introductory article which focuses on fetching and updating databases using the DataContext object in "LINQ to SQL." By reading this article, you will learn how to work with "LINQ to SQL" manually, without using a designer and with great simplicity. It should serve to give a solid foundation to both VB and C# programmers.

    I will not be including great theories of LINQ or related technologies in this article; Microsoft already features great content on those topics on its MSDN. If you are absolutely new to LINQ, I request that you go through the information you'll find at this link first:


    http://msdn2.microsoft.com/en-us/netframework/aa904594.aspx


    The entire source code for this article is available in the form of a free downloadable zip file. The solution was developed using Microsoft Visual Studio 2008 Team Edition on Microsoft Windows Server 2003 Standard Edition with Microsoft SQL Server 2005 Developer Edition. I didn't really test it in any other environment. I request that you post in the discussion area if you have any problems in execution.

    Developing a simple "LINQ to SQL" application (without LINQ designer): creating the project

    It is always easier to work with wizards and designers rather than coding manually. But when it comes to customizing the auto-generated code, we should have a fair understanding of generated code and its related pieces.

    We can generate lots of code automatically using Visual Studio designers (like DataSet Designer, LINQ to SQL Designer, etc.). As this is the most fundamental article on "LINQ to SQL," I would like to introduce the manual way of coding first rather than using "LINQ to SQL Designer" and complicating things. This is only to give you a better understanding of "LINQ to SQL" from the point of view of grasping the basics. My upcoming articles gradually focus on working with LINQ to SQL Designer.

    To make this article simple, I created two tables, "emp" and "dept" as follows:


    The following are the steps for creating an ASP.NET 3.5 application with "LINQ to SQL" support:

    • Open Visual Studio 2008

    • Go to File || New || Project

    • In the "New Project" dialog, make sure ".NET Framework 3.5" is selected. In the "Project Type," select either "Visual Basic || Web" or "Visual C# || Web."

    • Select "ASP.NET Web Application" in the templates, provide the name of the application (Fig 3) and finally hit the OK button.

     

    More .NET Articles
    More By Jagadish Chaterjee


       · Hello guys,I am back with a series on "LINQ to SQL" using Visual Studio 2008. ...
       · WHat is that in new LINQ in VS2008.?Can any one explain it..............?
     

    .NET ARTICLES

    - Knowing Your Environment: the System.Environ...
    - Creating the Home Page for a Simple Storefro...
    - LINQ Quickly with Language Integrated Queries
    - Introducing LINQ to SQL Designer using Visua...
    - Beginning LINQ to SQL Using Visual Studio 20...
    - Coding an AjaxPro.NET Based Search Engine fo...
    - Building an AjaxPro.NET Based Search Engine ...
    - Delving Deeper into Serialization with .NET
    - Serialization with .NET
    - Understanding Interface-Based Programming
    - Generics and Interface-Based Programming
    - Delving Deeper into Interface-Based Programm...
    - Interface-Based Programming
    - The Why and How of the SplitContainer Control
    - Building an ASP.NET 2.0 Master Page in Three...




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway