C#
  Home arrow C# arrow LINQ-to-MySQL with DbLinq in C#
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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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? 
C#

LINQ-to-MySQL with DbLinq in C#
By: Barzan "Tony" Antal
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 10
    2009-03-12

    Table of Contents:
  • LINQ-to-MySQL with DbLinq in C#
  • Preliminary Tasks
  • Let's Do It!
  • Final Thoughts

  • 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
     
     
    ADVERTISEMENT


    LINQ-to-MySQL with DbLinq in C#


    (Page 1 of 4 )

    You are reading the sequel to the "LINQ to MySQL, Oracle and PostgreSQL Providers" article that was also published here on Dev Shed. In this part we are going to provide an example of implementing LINQ-to-MySQL using the DbLinq Provider. We are going to use the C# programming language in the Visual Studio 2008 IDE.

    This article presumes a sound knowledge of LINQ and familiarity with RDBMS and C#. We are going to use the DbLinq Provider because it's free and open source. Even though right now it's heavily under development and doesn't match production quality, it is highly promising. MySQL is also a free open source RDBMS. And while LINQ was specifically designed for MS SQL Server and Access, providers are kind of struggling.

    It is strongly advised that you reread the previous article of this series. On the third page of that article I summed up in a nutshell the basic guidelines for working with DbLinq, starting from how to configure through implementing it into your project. Eventually, we will still go through those actions in this article, too.

    Before we begin I should clarify something. The application we are creating relies heavily on the database scheme. It also assumes that you are absolutely sure that MySQL server is up and running on your system. Likewise, it assumes that you know the details of the configuration of the server (like the IP address, or localhost if it runs on your system, root password, etc.).

    As mentioned in our previous article, the example that will be presented here in this article is a minimalist hotel management application. There is a database called hotelsdb that contains numerous tables. Right now we are going to work only with the Hotels and Clients tables. These two tables have particular fields.

    Hotels(IdHotel, Name, Rating, [...])

    Clients(IdClient, Name, Address, ZIP, Phone)

    The [...] part of the Hotels table stands for various foreign keys that maintain the relationships between other tables, such as the Location, Manager, Company, Facilities, and so forth. Obviously, you need to implement the application to your own database scheme. But this information was required so that you can imagine the scheme we are working with during this article. These are all of the details you need to know.

    These being said, fire up your Visual Studio 2008 and let's begin.

    More C# Articles
    More By Barzan "Tony" Antal


       · Hi, Its very nice article on Linq to sql but i m having some problem when i m...
     

    C# ARTICLES

    - Cyclic Redundancy Check
    - Handling Methods and Functions
    - Destroying Objects in C#
    - Creating Objects in C-Sharp
    - Classes and Objects
    - Programming Languages: Managed versus Native
    - LINQ-to-MySQL with DbLinq in C#
    - Working with Dates and Times in C#
    - Generics, Dictionaries, and More
    - More About Generics
    - Working with C# Collections
    - Generics
    - C# and XML
    - Pointers and Arrays in C#
    - C# 3.0 Extension Methods





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 1 Hosted by Hostway
    Stay green...Green IT