从SQL Server绑定,更新,删除数据到ASPX页面的最佳方法? [英] best way to bind,upade,delete data from sql server to aspx page?

查看:180
本文介绍了从SQL Server绑定,更新,删除数据到ASPX页面的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多方法可以将数据从sql绑定到aspx页面.
1.使用数据集
2. sqldatasourse或entitydatasource到datacontrol
3.用于带有后端编码的数据控制
4.具有自动更新,删除等功能的数据控件.
5.在后端连接断开模式下进行查询.
5.使用存储过程
还有更多...

那么实际的最佳方法是什么,或者业界认为它是软件开发人员的正确编码方式,为什么????

There are many ways we can bind data from sql to aspx page.
1. using dataset
2. sqldatasourse or entitydatasource to datacontrol
3. for datacontrols with back end coding
4. datacontrols with automatic updation, deletion..etc
5. in back end connected-disconnected mode with query.
5. using stored procedure
any many more...

So what is the actual best way or the industry thinks its the proper way of coding for software developer and why?????

推荐答案



每个选项都有自己的优点和缺点.

而且我们应该按照我们的要求使用.

SP最好,因为它可以保留编译代码,因此它高效且快速.
如果仅希望对数据进行fwd读取访问,请使用DataReader.
如果要修改更改和数据以及向后或多次遍历数据,请使用DataSet.

实体框架/LINQ to SQL/nHibernate有时会提供良好的性能.
Hi,

Each option has their own advantages and disadvantages.

And we should use as per our requirement.

SP is best because it keeps compile code, So it is efficient and fast.
Use DataReader if you only want fwd read access of data.
Use DataSet if you want to modify the changes and fwd as well as backward or multiple traverse of data.

Entity Framework / LINQ to SQL / nHibernate gives good performance some time.


这篇关于从SQL Server绑定,更新,删除数据到ASPX页面的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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