webmatrix 数据库类在内部使用 ADO.Net 吗?
Database 类是否只是 ADO.NET 的包装器,它使 db 的使用更简单?它的局限性是什么?
Is Database class just a wrapper for ADO.NET which makes use of db simpler ? What's its limits ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的 - 数据库助手是 ADO.NET 的包装器。它旨在最大限度地减少初学者查询数据库所需的代码,类似于 PHP 中的操作方式。它的局限性取决于您的观点。作为刚刚开始学习 Web 开发和数据库的人,您可能会认为这个助手是天才之举。作为一名专业开发人员,您可能不喜欢它返回动态类型,或者它不能阻止人们动态构建 SQL 并可能使其应用程序遭受 SQL 注入攻击。
Yes - the Database Helper is a wrapper around ADO.NET. It is designed to minimize the code that a beginner needs to get started with querying databases, similar to how its done in PHP. Its limits depend on your point of view. As someone who is just starting to learn web development and databases, you might think that the helper is a stroke of genius. As a professional developer, you might not like the fact that it returns dynamic types or that it doesn't prevent people dynamically constructing their SQL and potentially opening up their application to SQL injection attacks.