Posts

Showing posts with the label LINQ to SQL

Learning LINQ to SQL (Part 2)

In my last post , I had worked through a few section of the white paper " LINQ to SQL: .NET Language-Integrated Query for Relational Data " and had gotten a working LINQ program going. Everything was going just fine... until now. At the end of the Defining Relationships section, the article leaves me kind'a hanging. It says "there is a tool (described later) that can be used to generate all the necessary definitions..." So, I've got to go back to the TOC to see what this "special tool" is for generating the Entities. I jump to "The Entity Class Generator Tool" section and start reading. My first order of business is to find the program called SqlMetal . I launch a COMMAND window and type "sqlmetal" and receive the expected " 'sqlmetal' is not recognized as an internal or external command. " error. Hey, it was worth a try! So, I next use the old stand-by " cd \ " then " dir /s sqlmetal.* ...

Learning LINQ to SQL

I've decided to spend a little time these next few evenings coming up to speed on LINQ (Language-Integrated Query) and writing about my experience with it. Let's see what sorts of problems I run into. I'm using as reference the 119 page LINQ to SQL: .NET Language-Integrated Query for Relational Data in order to jump start my learning. I hope that my SQL and C# experience will give me a head start and keep me moving. But, I have done nothing yet with the Northwind sample database (the database used in the white paper) in any of my projects or tests. I am not even sure where to get it yet. Ha, ha, Noobie on the loose, let me at it... Let's Create some Entity Classes . The white paper starts out with creating entity classes. Granted, I'm starting in the "Quick Tour" section of the white paper, so I expect to find some detail ommisions. I'll take my chances. So, I jump right into the declaration of the Customer class. [Table(Name="Custo...