如何将用户输入存储在数据库中?
我是这方面的新手,所以请对我好一点 =^)
我正在使用 ASP.net 创建一个网站,并且有一个注册页面。用户必须在文本框中输入名称和密码,并从下拉列表中选择加入的位置和原因。 (有一个内置的新用户注册向导,但我选择不使用它)。 我想将在数据库表中输入的信息保存在 App_Data 文件夹中。我该怎么做?
I'm a newbie at this, so please be nice to me =^)
I'm creating a website with ASP.net and I have a sign up page. The user has to enter a name and password in textboxex, and choose a location and reason for joining from dropdown lists. (There is a built in wizard for new user sign-up but I chose not to use it).
I would like to save the information entered in a table in a database in the App_Data folder. How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您还需要学习 ADO.NET,它是 .Net 选择的数据库访问技术。
这是一个基本教程来帮助您入门...
还可以在谷歌上搜索asp. net ado.net 教程 将会带来不错的点击率。
You will also need to learn ADO.NET which is the database access technology of choice for .Net.
Here's a basic tutorial to get you started...
Also Googling for asp.net ado.net tutorial will bring up good hits.
如果您要创建面向公众的网站,则需要认真考虑如何处理、存储和检索用户信息。 ASP.NET 使用
Membership
类为此类事情提供了许多良好的功能。您将在 System.Web.Security 命名空间中找到此类。您还可以使用
aspnet_regsql.exe
应用程序生成正确存储此信息所需的表和存储过程(即存储密码和秘密问题/答案等的哈希值)。可以在 ASP.NET 网站以及MSDN。
正如 ASP.NET 教父 Scott Guthrie 可能会说的那样:“希望这会有所帮助。”
If you're creating a public-facing website, you need to put some serious thought into how you process, store, and retrieve user information. ASP.NET provides a lot of good functionality for this type of thing using the
Membership
class. You'll find this class in theSystem.Web.Security
namespace.You can also use the
aspnet_regsql.exe
application to generate the tables and stored procedures necessary to store this information correctly (i.e. storing hashed values for passwords and secret questions/answers, etc.)As mentioned previously, many good tutorials (both written and video) can be found on these topics on the ASP.NET site as well as on MSDN.
As the godfather of ASP.NET, Scott Guthrie, might say: "Hope this helps."
您需要:
1) 拥有代表数据库的模式并在计算机上创建它
2) 能够对数据执行查询
3) 编写查询以将用户数据插入数据库。
我确信 google 有大量 ASP 教程。
You need to:
1) Have a schema representing the database and create it on the machine
2) Have an ability to execute queries against the data
3) Write a query to insert the user data into the database.
I'm sure google has a ton of ASP tutorials.