保存c#Web表单以访问数据库 [英] Save c# Web form to access datbase

查看:77
本文介绍了保存c#Web表单以访问数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我创建了一个ASP.NET Web应用程序,我创建了3个需要用户输入的页面。这些表格有标签,复选框,文本框,下拉列表等。

我正在寻找用户填写这些表格然后在每页底部输入他们的名字和姓氏然后单击保存以保存输入的全部数据。 (标签,文本框和按钮)

我想在我创建的另一个页面的网格视图中显示这些页面,因此用户可以根据需要修改这些页面。

执行此操作的最佳方法是什么?

我最初想将整个Web表单保存到我创建的ms数据库中,然后将此数据加载到网格视图中。我能够保存文本字段,但不能保存复选框和下拉列表。此外,页面上的一些数据已在代码中修复,它不需要任何用户输入。

任何有关此问题的帮助将不胜感激。

Hello
I have created a ASP.NET web application, I have created 3 pages that require user input. These forms have labels, check boxes, text boxes, drop down list etc..
I am looking the user to fill out these forms then enter their first and last name at the bottom of each page and then click save to save the entire data entered. (labels, text boxes and button)
I then want to display these pages in a grid view on another page I have created, so the user can modify these if needed.
What is the best way to do this???
I initially wanted to save the entire web form to a ms database I created, then load this data into grid view. I was able to save the text fields but not the check boxes and drop down lists. Also some of the data on the page is fixed in the code, it doesn't require any user input.
Any help on this would be appreciated thanks.

推荐答案

你可以自己谷歌搜索并找到解决方案的数量:

试试以下

http://www.aspdotnet-suresh.com/2010/10/how-to-get-output- parameters-return-by.html [ ^ ]



http://csharpdotnetfreak.blogspot.com/2012/01/user-registration-form-aspnet.html [ ^ ]
You can google it by yourself and can find number of solution:
Try following
http://www.aspdotnet-suresh.com/2010/10/how-to-get-output-parameters-return-by.html[^]

http://csharpdotnetfreak.blogspot.com/2012/01/user-registration-form-aspnet.html[^]


如果你想节省如果是复选框值,则必须在数据库表中将列的数据类型设置为。 bcz复选框值是布尔类型



和数据库表位类型为布尔值。

下拉列表nvarchar类型没问题,值应该是dropdown1.text



和复选框..checkbox1.Value



让我知道它对你有帮助
If you want to save the checkbox value then you have to set the datatype of column to bit in database table . bcz checkbox value is boolean type

and in database table bit type as boolean.
for dropdown list nvarchar type is ok and the value should be dropdown1.text

and for checkbox ..checkbox1.Value

let me know it help you or not


这篇关于保存c#Web表单以访问数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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