ADO.NET和LINQ to SQL的? [英] ADO.NET or Linq to SQL?

查看:166
本文介绍了ADO.NET和LINQ to SQL的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立了一个论坛,它已得到4个表:用户,线程,评论,主题

I am building a forum, and it has got 4 tables: Users, Threads, Comments, Topics.

我建立的连接和页面..我开始使用ADO.net方式接入数据并选择data..but然后我发现,让更多的复杂的操作,我需要知道SQL。所以我一直在寻找另一种方式,而且我发现我可以打开Visual Studio 2010,添加的LINQ到生产对象关系设计SQL文件。我读到有关如何编写code,我看到,我只需要使用一个using语句与DataContext对象用一个简单的code更新,添加,删除行的表。

I established the connection and the pages.. I started using the ADO.net way to insert data and select data..but then i found that to make more complex manipulations i need to know SQL. So i was looking for another way, and i found that i can open visual studio 2010, add Linq to SQL file that produced object relational designer. I read about how to write code, and i saw that i simply need to use a using statement with DataContext object with a simple code to update,add,delete rows in the tables.

我想知道,有什么用querrying的一种方式在另一个的优点是什么?

I wanted to know, what are the advantages of using one way of querrying over another?

推荐答案

LINQ to SQL的是技术ADO.NET家族的一员。它是基于由ADO.NET提供模型所提供的服务。因此,您可以混合使用的LINQ to SQL code与现有的ADO.NET应用程序和当前ADO.NET解决方案,LINQ迁移到SQL。下图提供关系的高级视图。

LINQ to SQL is part of the ADO.NET family of technologies. It is based on services provided by the ADO.NET provider model. You can therefore mix LINQ to SQL code with existing ADO.NET applications and migrate current ADO.NET solutions to LINQ to SQL. The following illustration provides a high-level view of the relationship.

请参考以下内容:

ADO.NET和LINQ to SQL

<一个href="http://social.msdn.microsoft.com/Forums/en-NZ/linqtosql/thread/cd952b8e-4bc6-4be9-87d3-cec7fbe7a0d8"相对=nofollow>优点和放大器; LINQ 的缺点

<一个href="http://social.msdn.microsoft.com/Forums/en-US/linqprojectgeneral/thread/3712aa37-d946-40ed-b72f-8f67a35709de"相对=nofollow> LINQ的性能到SQL在普通存储过程

LINQ到SQL和存储过程

这篇关于ADO.NET和LINQ to SQL的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆