接受& amp;验证用户输入并将该输入保存到SQL Server [英] Form which accepts & validate user input and saves that input to SQL Server

查看:74
本文介绍了接受& amp;验证用户输入并将该输入保存到SQL Server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我在Asp.Net 2.0,SQL Server,C#工作。

我正在尝试创建一个用户输入表单很多字段如:

称呼;

名字:

姓:

地址:

邮编:

电话:

行业:

等等。我想验证用户输入,而不是应该保存到sql server 2005,另外如果能够发送电子邮件也会很棒。请你带我去看一篇可以指导我完成这个过程的文章或教程。这将是我第一次创建一个巨大的表单,在此之前我通过使用sqldatasource和asp.net 2.0的formview创建了一个小表单。任何帮助将不胜感激。


谢谢你

Hi,

I am working in Asp.Net 2.0, SQL Server, C#.
I am trying to create a User Input form which has lots of fields such as :
salutation;
Firstname:
lastname:
address:
Zip:
Phone:
Industry:
and many more. i want to validate user input and than it should save into sql server 2005 and additionally if am being able to send email also that will be great. could you please lead me toward a article or tutorial which can guide me through this process. This is gonna be first time that I am creating a huge form, before this i have created a small forms by using sqldatasource and formview of asp.net 2.0. any help will be appreciated.

Thank You

推荐答案


你好,


我在Asp.Net 2.0,SQL Server,C#工作。

我正在尝试创建一个包含许多字段的用户输入表单as:

称呼;

名字:

姓:

地址:

邮编:

电话:

行业:

等等。我想验证用户输入,而不是应该保存到sql server 2005,另外如果能够发送电子邮件也会很棒。请你带我去看一篇可以指导我完成这个过程的文章或教程。这将是我第一次创建一个巨大的表单,在此之前我通过使用sqldatasource和asp.net 2.0的formview创建了一个小表单。任何帮助将不胜感激。


谢谢你
Hi,

I am working in Asp.Net 2.0, SQL Server, C#.
I am trying to create a User Input form which has lots of fields such as :
salutation;
Firstname:
lastname:
address:
Zip:
Phone:
Industry:
and many more. i want to validate user input and than it should save into sql server 2005 and additionally if am being able to send email also that will be great. could you please lead me toward a article or tutorial which can guide me through this process. This is gonna be first time that I am creating a huge form, before this i have created a small forms by using sqldatasource and formview of asp.net 2.0. any help will be appreciated.

Thank You



您可以在Google或其他搜索引擎中搜索C#验证用户输入和你应该得到一些例子。只需考虑将页面设计成碎片。从名字和姓氏等基本信息开始,然后测试您的验证。要将数据插入数据库,您需要一些插入存储过程。您的存储过程很可能为页面上的每个字段都有一个参数。


祝你好运


Nathan

You could search Google or another search engine for C# validate user input and you should get some examples. Just think about designing your page in pieces. Start with basic information like first name and last name then test your validation. To insert the data into a database you will need some insert stored procedures. Your stored procedure will most likely have a parameter for every field on the page.

Good Luck

Nathan






我在Asp.Net 2.0,SQL Server,C#工作。

我正在尝试创建一个有很多字段的用户输入表单例如:

称呼;

名字:

姓:

地址:

邮编:

电话:

行业:

等等。我想验证用户输入,而不是应该保存到sql server 2005,另外如果能够发送电子邮件也会很棒。请你带我去看一篇可以指导我完成这个过程的文章或教程。这将是我第一次创建一个巨大的表单,在此之前我通过使用sqldatasource和asp.net 2.0的formview创建了一个小表单。任何帮助将不胜感激。


谢谢
Hi,

I am working in Asp.Net 2.0, SQL Server, C#.
I am trying to create a User Input form which has lots of fields such as :
salutation;
Firstname:
lastname:
address:
Zip:
Phone:
Industry:
and many more. i want to validate user input and than it should save into sql server 2005 and additionally if am being able to send email also that will be great. could you please lead me toward a article or tutorial which can guide me through this process. This is gonna be first time that I am creating a huge form, before this i have created a small forms by using sqldatasource and formview of asp.net 2.0. any help will be appreciated.

Thank You



如果您愿意,我将很乐意引导您完成整个过程。第一步应该是创建HTML(或至少它的一个工作部分)。


您将需要< asp:Label>'和< asp:TextBox>对于田野来说。我会使用标准的命名约定,所以例如第一个名称的标签就像lblFirstName,它的相应TextBox就是txtFirstName。


一旦完成,你将需要验证器以确保输入有效。除了Phone和Zip之外的所有内容都将使用RequiredFieldValidators。对于Phone和Zip文本框,请使用RegularExpressionValidators。 VS 2005中有一些预先构建的表达式,幸运的是有美国电话和美国邮政编码。使用带有相应文本框的那些。


完成所有这些后,我将帮助您完成下一步。



编辑:


如果你想要链接到网站,这里有一些:

有关SQL的INSERT语句的信息

有关通过ASP .NET发送电子邮件的信息


谢谢TRScheel。一旦完成,我会回来寻求帮助。
Thank You TRScheel. as soon as finish this i''ll back to seek help.


这篇关于接受&amp; amp;验证用户输入并将该输入保存到SQL Server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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