数据读取器,项目中的内联查询用法 [英] Data Reader, Inline Queries Usage in Project

查看:90
本文介绍了数据读取器,项目中的内联查询用法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Asp.Net项目中工作,我们正在使用3-Tier体系结构.在数据访问层中,我们使用"内联查询"进行数据处理,并使用"数据读取器"进行绑定到网格.这是一个好方法吗?..有人可以建议我正确的方法吗?

Hi, I am working with the Asp.Net project and we are using 3-Tier architecture. In Data Access Layer we using "Inline queries" for data manipulation and "Data Reader" for binding into Grid. Is it a Good approach?.. can anyone please suggest me the right approach???

推荐答案

什么是内联查询"?您在数据层中输入mash SQL吗?只要您使用参数化查询,这样它们就可以免受注入攻击,并将它们全部放入您的数据层,这对我来说似乎并不坏.

数据层是否应返回强类型列表或数据读取器类型对象,这是讨论的问题.我从事的项目既有优势又有缺点.
What is an ''inline query'' ? You string mash SQL in your data layer ? So long as you use paramaterised queries so they are safe from injection attacks and put them all in your data layer, that doesn''t seem bad to me.

It''s a matter of discussion if a datalayer should return a strongly typed list or a data reader type object. I''ve worked on projects that do both and seen pros and cons of each.


我认为数据集是最好的方法,因为它提供了断开连接的体系结构.

希望对您有帮助....:)
I think dataset is the best approach since it provide disconnected architecture.

Hope this may help u.... :)


这篇关于数据读取器,项目中的内联查询用法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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