Welcome to My Website

DBLinq and ORM

Posted by Abbas Tuesday, July 27, 2010 0 comments

LINQ is an ORM made by Microsoft.ORM is an Object Relation Mapper but Iam not getting into  what a ORM is   right now.

LINQ stands for Language INtegrated Query.

So why I should use an ORM?Well 1 reason is that less code has to be written,so less development time.

We will be discussing how to use LINQ with MySQL.
For using Linq with MySQL we need the following:
1.DbLinq Download
Download it from link given.

2.Download MySQL connector from link given. MySQL Download

3. Make a new desktop application in VS2008 in C#







4.Add two forms:AddEmpLoyee and Form1.


5.Add following references the link given in 1:
a.MySQL.Data.dl
b.DbLinq.MySQl.dll
c.Dblinq.dll

Checkout at Amazon.com:


5.compile Press F6.
6.Go to:start>Programs>Visual studio tools>VS2008 Command Prompt
7:Type following command:
DbMetal.exe -provider=MySql -database:school -server:localhost -user:root -password: -namespace:school -code:school.cs -sprocs

8.DbMetal.exe -provider=MySql -database:school -server:localhost -user:root -password: -namespace:school -dbml:school.dbml -sprocs

9.Copy generated files:school.cs and school.dbml to your Project.

10.Delete school.layout.cs and school.designer.cs
Note school will be replaced by your database name.Here school is name of my database.

11.Open school.cs rename any table with 's' to just singular.Like Students to student.

12.Now you are about to roll!

Welcome To iTech Showcase

Posted by Abbas Monday, July 26, 2010 1 comments

Which Software tutorial site you think is most helpful?

Slideshow