为什么ASP.NET数据访问如此丑陋?

时间:2021-12-24 00:20:47

I can't figure how to make a decent website without using the asp.net builtin data controls like SqlDataSource and DataGrid. Is there a cleaner way to do this?

我不知道如何在不使用像SqlDataSource和DataGrid这样的asp.net内置数据控件的情况下建立一个像样的网站。有更清洁的方法吗?

1 个解决方案

#1


6  

Yes there is, you don't really need an SqlDataSource, theres a reason for web.config files and stored procedures. You're going to have to read about how to use ASP.net to connect to a database and how to pull data using parameterized stored procedures. Look up web.config file, connection strings, and system.data.sql.

是的,你真的不需要一个SqlDataSource,这是web.config文件和存储过程的原因。您将不得不阅读有关如何使用ASP.net连接到数据库以及如何使用参数化存储过程提取数据的信息。查找web.config文件,连接字符串和system.data.sql。

#1


6  

Yes there is, you don't really need an SqlDataSource, theres a reason for web.config files and stored procedures. You're going to have to read about how to use ASP.net to connect to a database and how to pull data using parameterized stored procedures. Look up web.config file, connection strings, and system.data.sql.

是的,你真的不需要一个SqlDataSource,这是web.config文件和存储过程的原因。您将不得不阅读有关如何使用ASP.net连接到数据库以及如何使用参数化存储过程提取数据的信息。查找web.config文件,连接字符串和system.data.sql。