从数据库填充文本框 - ASP.NET [英] Filling textboxes from database - ASP.NET

查看:101
本文介绍了从数据库填充文本框 - ASP.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。我正在构建一个ASP应用程序,我们有一个名为Clients的表,我想在带有文本框的表单上显示特定的客户端记录。换句话说,我希望在一个框中有第一个名字,在另一个框中有中间名,在另一个框中有姓,你就明白了。我还需要能够更新这些记录,以及使用这些文本框添加新记录。到目前为止我所做的一切都失败了。有人可以在这项任务中给我一些指导吗?任何帮助将不胜感激。谢谢。

Hello, all. I am building an ASP application where we have a table named Clients and I am wanting to display a specific client record on a form with textboxes. In other words, I want to have the first name in one box, middle name in another, last name in another, you get the idea. I will also need to be able to update these records, as well as add new records using these textboxes. All I have tried so far has failed. Can someone give me some guidance in this task? Any assistance will be greatly appreciated. Thanks.

推荐答案


你好,全部。我正在构建一个ASP应用程序,我们有一个名为Clients的表,我想在带有文本框的表单上显示特定的客户端记录。换句话说,我希望在一个框中有第一个名字,在另一个框中有中间名,在另一个框中有姓,你就明白了。我还需要能够更新这些记录,以及使用这些文本框添加新记录。到目前为止我所做的一切都失败了。有人可以在这项任务中给我一些指导吗?任何帮助将不胜感激。谢谢。
Hello, all. I am building an ASP application where we have a table named Clients and I am wanting to display a specific client record on a form with textboxes. In other words, I want to have the first name in one box, middle name in another, last name in another, you get the idea. I will also need to be able to update these records, as well as add new records using these textboxes. All I have tried so far has failed. Can someone give me some guidance in this task? Any assistance will be greatly appreciated. Thanks.



构建HTML表单后,您需要做4件事。


1)建立连接到您的数据库
http://www.connectionstrings.com


2)通过SQL脚本读取该数据库,将数据加载到页面上的变量中。
http://www.w3schools.com/sql/sql_select.asp


3)设置表单对象值等于您从数据库设置的变量

4)在保存时,您需要通过request.form语法从表单重新获取用户输入的数据,然后使用SQL Update更新您的记录在数据库中
http://www.w3schools.com/ sql / sql_update.asp


要完成所有这些,您还需要了解ASP in一般以及如何使用其语法在实际页面上完成工作
http://www.w3schools.com/asp/asp_intro.asp


目前我配置了SqlDataSource并构建了表单。 SqlDataSource不会处理连接吗?
At the moment I have a SqlDataSource configured and the form is built, of course. Wouldn''t the SqlDataSource take care of the connection?



目前我配置了SqlDataSource并构建了表单,课程。 SqlDataSource不会处理连接吗?
At the moment I have a SqlDataSource configured and the form is built, of course. Wouldn''t the SqlDataSource take care of the connection?



这是否意味着你正在使用ASP.NET?


我给你的方向是专门针对Classic ASP的。 br />

如果你正在使用.NET这是一个全新的球类游戏,你将需要做什么。

Does that mean you are using ASP.NET ?

The direction I gave you was specifically for Classic ASP.

If you are using .NET its a whole new ball game for what you will need to do.


这篇关于从数据库填充文本框 - ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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