I am in the process of watching a video about pulling back records form a database using LINQ to SQL. This is new functionality that comes in .NET 3.0 or 3.5 (not exactly sure which one). I do know MVC is not available to use unless you have Framework 3.5 installed so we will go with that anyway. I was just looking at a video that indicate there are two ways to run a ‘query’ using LINQ to SQL. Below are the two ways. We were working with movies so the queries are for movies. Here they are:
Query Syntax:
Dim movies = From m In dataContext.Movies Select m
Method Syntax:
Dim movies = dataContext.Movies.Select(Function(m) m)
Both of the statements pull back all rows from the movies table. Pretty crazy if you ask me. I personally like the first statement. It is easier to read in my opinion. I will be venturing into learning MVC with the help of several people (Scott Guthrie, Stephan Walther, and Scott Hanselman amoung others [Google]). I don’t think there are many books out on it yet. I am usign MVC release candidate currently. As I go through the steps of learning I will post what I learn. I will also post the steps to getting to this point at a later date. Have fun coding and as always, if there are any questions or suggestions, they are welcome. Thank you.