Building a Simple Blog Engine with ASP.NET MVC and LINQ - Part 3
page 4 of 8
by Keyvan Nayyeri
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 60275/ 105

LINQ to SQL

For KBlog I want to use a LINQ to SQL mechanism to load data to the data model and pass them to controller actions. Using LINQ to SQL is pretty easy and should be common knowledge for a normal .NET developer, but since it's a new technology just let me point that you can add a new LINQ to SQL Classes item to your Models folder in ASP.NET MVC project as shown in Figure 2.

Figure 2

After adding this item to your project you can drag and drop database tables to the designer and don't need to do anything else because this is all we need for this example.

Your LINQ to SQL designer should look like Figure 3 after that.

Figure 3


View Entire Article

User Comments

Title: 2012 NFL jerseys   
Name: NIKE NFL jerseys
Date: 2012-05-20 11:28:39 PM
Comment:
[/pre]Cheap NFL,NBA,MLB,NHL
[url=http://www.jersey2shop.com/]Jerseys From China[/url]
[url=http://www.jersey2shop.com/]2012 nike nfl Jerseys[/url]
[url=http://www.jersey2shop.com/]cheap China Jerseys[/url]
[url=http://www.jersey2shop.com/]Sports Jerseys China[/url]
[url=http://www.jersey2shop.com/NFL-Jerseys-c68/]NFL Jerseys China[/url]
[url=http://www.jersey2shop.com/NBA-Jerseys-c77/]NBA Jerseys China[/url]
NHL Jerseys China
[url=http://www.jersey2shop.com/MLB-Jerseys-c94/]MLB Jerseys China[/url]NFL jerseys For Sale online.All Our Jerseys Are Sewn On and Directly From Chinese Jerseys Factory
[/pre]
[pre]We Are Professional China jerseys Wholesaler
[url=http://www.cheapjersey2store.com/]Wholesale cheap jerseys[/url]Cheap mlb jerseys
[url= http://www.cheapjersey2store.com/]2012 mlb all atar jerseys[/url]
[url= http://www.cheapjersey2store.com/ [/url]Cheap China Wholesael[/url]
[url= http://www.cheapjersey2store.com/]Wholesale jerseys From China[/url]
[url=http://www.cheapjersey2store.com/]2012 nike nfl Jerseys[/url]Free Shipping,Cheap Price,7 Days Deliver
[/pre]
[/pre]
We are professional jerseys manufacturer from china,wholesal
sports [url= http://www.cheapjersey2store.com/]Jerseys From China[/url]
[url=http://www.cheapjersey2store.com/NFL-Jerseys-c68]NFL jerseys China[/url]
[url=http://www.cheapjersey2store.com/NHL-Jerseys-c96/]NHL Jerseys China[/url]
[url=http://www.cheapjersey2store.com/NBA-Jerseys-c77/]NBA Jerseys China[/url]
[url=http://www.cheapjersey2store.com/MLB-Jerseys-c94/]MLB Jerseys China[/url]
[url= http://www.cheapjersey2store.com/]China Jerseys[/url],Free Shipping
[/pre]
[/pre]
We are professional jerseys manufacturer from china,wholesal
sports [url= http://www.jerseycaptain.com/]cheap jerseys sale online [/url]
[url= http://www.jerseycaptain.com/]2012 nike nfl Jerseys[/url]
[url=http://www.jerseycaptain.com/NFL-Jerseys-c68]cheap NFL jerseys China[/url]
[url=http://www.jerseycaptain.com/NHL-Jerseys-c96/]NHL Jerseys C
Title: grignolino   
Name: tomy.algoria@gmail.com
Date: 2010-03-09 6:03:43 AM
Comment:
This blog contains really good stuff.Thanks for sharing this interesting blog.
Title: Microsoft Training Word   
Name: Tuzigoot
Date: 2010-01-29 1:26:58 AM
Comment:
Looks like an Ebook that you can get something better idea.
Title: Quality SEO Services   
Name: Lurus
Date: 2010-01-29 1:25:42 AM
Comment:
This article gave me better idea on how implement such things something like this.
Title: Quality SEO Services   
Name: Lurus
Date: 2010-01-29 1:25:20 AM
Comment:
This article gave me better idea on how implement such things something like this.
Title: Agenzia Web Marketing   
Name: Agenzia Web Marketing
Date: 2009-12-09 5:55:22 AM
Comment:
Good Post.It's really helpful and interesting
Title: Commentary   
Name: maria tere
Date: 2009-04-22 9:49:51 AM
Comment:
i think the example of LINQ to SQL is very poor, because the use of that class is more extensible.
Title: Busby SEO Test   
Name: info@gmail.com
Date: 2008-12-22 12:07:27 AM
Comment:
thank you very much
Title: Question   
Name: Michael
Date: 2008-12-06 6:31:47 AM
Comment:
Hi, how about if our sample url is '/2008/12/06/post-title-here' just like what Wordpress did, is it possible?
Title: Nevermind   
Name: Nick Kirkes
Date: 2008-04-26 7:07:31 PM
Comment:
Just realized I am missing the DBDataContext.
Title: context.Posts?   
Name: Nick Kirkes
Date: 2008-04-26 7:06:44 PM
Comment:
Thanks for the article.

I'm following your guidance, but I can't build as the "context.Posts" don't exist (same for categories). Am I missing something?
Title: anxiously awaiting...   
Name: Emiel
Date: 2008-04-24 3:06:02 AM
Comment:
Here's another one waiting for part 4...
When, when, WHEN?
Title: And the part 4?   
Name: lxx
Date: 2008-04-17 11:42:43 AM
Comment:
I wait for your next artical.Thanks.
Title: Reply to Mike   
Name: Keyvan Nayyeri
Date: 2008-03-28 8:53:51 AM
Comment:
Mike,

I'll send it to editorial team in the next three days so I expect it to be published in the next couple of weeks.
Title: Expectation?   
Name: Mike Mayers
Date: 2008-03-28 8:45:08 AM
Comment:
Is there any prevision about the release of the 4th part? Can't wait to see it. Very nice.
Title: Very good!!!!!   
Name: Marcelo
Date: 2008-03-27 4:35:06 PM
Comment:
Very good tutorial! Am waiting anxiously for the "View" part!!! Thank you.

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2021 ASPAlliance.com  |  Page Processed at 2021-12-04 9:30:05 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search