本文介绍了如何在SQL Server中提交Html表单数据?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我想将我的html表单数据提交到Sql server数据库,或者我也可以将此数据发送到我的电子邮件ID ........ 请告诉我我需要做这项工作...... < html > < head > < style type = text / css > 。设计 { border : 1.5px solid#3267cd; padding : 9px; - webkit-border-radius : 20px; - moz -border-radius : 20px; border-radius : 12px; font-size : 15px; font-weight : 粗体; color : #333; } 。 button_example { border : 1px solid#495267; - webkit-box-shadow : #4C9DB5 0px 2px 2px; - moz- box-shadow : #4C9DB5 0px 2px 2px; box-shadow : #4C9DB5 0px 2px 2px; - webkit-border-radius : 12px; - moz-border-radius : 12px; border-radius : 12px; width : 120px ; font-size : 18px; font-family : arial,helvetica,sans -serif; padding : 5px 5px 5px 5px; text-shadow : 3px 3px 0 rgba(19,20,20,0.3); font-weight : bold; text-align : center; 颜色 : #DEF2FF; background-color : 3267cd; background-image : -webkit-gradient(线性,左上,左下,从(#abd4f2)到(#3267cd)); background-image : -webkit-linear-gradient(top,# abd4f2,#3267cd); background-image : -moz-linear-gradient(top,#abd4f2,#3267cd); background-image : -ms-linear-gradient(top,#abd4f2,#3267cd); background-image : -o-linear-gradient(top,#abd4f2, #3267cd); background-image : 线性渐变(到底部,#abd4f2,#3267cd); 过滤器 : progid:DXImageTransform.Microsoft.gradient(GradientType = 0,startColorstr =#abd4f2, endColorstr =#3267cd); } 。 button_example:hover { border : 1px solid#363d4c; background-color : #4B546A; background-image : -webkit-gradient(linear,left top,左下角,从(#4B546A),顶部(#2c354b)); background-image : -webkit-linear-gradient(top,#4B546A,#2c354b); background-image : -moz-linear-gradient(top,#4B546A,#2c354b); background-image : -ms-linear-gradient(top,#4B546A,#2c354b) ; background-image : -o-linear-gradient(顶部,#4B546A,#2c354b); background-image : 线性渐变(到底部,#4B546A,#2c354b); 过滤器 : progid:DXImageTransform.Microsoft.gradient(GradientType = 0,startColorstr =#4B546A,endColorstr =#2c354b); } 。 button_example1 { border : 2px solid#495267; - webkit-box-shadow : #4C9DB5 0px 2px 2px; - moz-box-shadow : #4C9DB5 0px 2px 2px; box-shadow : #4C9DB5 0px 2px 2px; - webkit-border-radius : 12px; - moz-border-radius : 12px; border-radius : 5px; width : 277px; font-size : 29px; font-family : arial,helvetica,sans-serif; padding : 5px 5px 5px 5px; text-shadow : 3px 3px 0 rgba(19,20,20,0.3 ); font-weight : bold; text-align : center; 颜色 : #DEF2FF; background-color : 3267cd; background-image : -webkit-gradient(线性,左上,左下,从(#abd4f2)到(#3267cd)); background- image : -webkit-linear-gradient(top,#abd4f2,#3267cd); background-image : -moz-linear -gradient(top,#abd4f2,#3267cd); background-image : -ms-linear-gradient(top,#abd4f2,#3267cd); background-image : -o-线性渐变(顶部,#abd4f2,#3267cd); background-image : 线性渐变(到底部,#abd4f2,#3267cd); 过滤器 : progid:DXImageTransform.Microsoft.gradient(GradientType = 0,startColorstr =#abd4f2,endColorstr =#3267cd); } <! - 。 button_example2:hover { border : 1px solid#363d4c; background-颜色 : #4B546A; background-image : -webkit-gradient(线性,左上,左下,来自(#4B546A) ),top(#2c354b)); background-image : -webkit-linear-gradient(顶部,#4B546A,#2c354b); background-image : -moz-linear-gradient(top,#4B546A,#2c354b); background-image : -ms-linear-gradient(top,#4B546A,#2c354b); background-image : -o-linear-gradient(top, #4B546A,#2c354b); background-image : 线性渐变(到底部,#4B546A,#2c354b); filter : progid:DXImageTransform.Microsoft。 gradient(GradientType = 0,startColorstr =#4B546A,endColorstr =#2c354b); } - > < / style > < title > 查询表< / title > < / head > < body > < div align = center > < table 对齐 = center border = 2px width = 22% bgcolor = BFBABC style = border-radius:10px 10px 10px > < tr height = 60px > < th > < font size = 20% 颜色 = silver > < 输入 type = button class = button_example1 value = 查询 / > < / font > < / th > < / tr > < tr align = center style = 填充:0px > < td > < 表格 > < / br > < 输入 class = design 类型 = text 占位符 = 名称 size = 30% maxlength = 30 样式 = padding-top:8px; background-color:white > < / br > < / br > < 输入 class = design type = text 占位符 = 课程 size = 30% maxlength = 30 style = padding-top:8px; background-color:white > < / br > < / br > < 输入 class = design type = text 占位符 = 电子邮件 size = 30% maxlength = 254 style = padding-top:8px; background-color:white > < / br > < / br > < 输入 class = design type = text 占位符 = 移动 size = 30% maxlength = 10 style = padding-top:8px; background-color:white > < / br > < / br > < textarea class = design name = query_message cols = 26 行 = 2 占位符 = 消息 maxlength = 300 样式 = background-color:white > < / textarea > < / br > < / br > <! - < input type =submitvalue =Submitstyle =height:35px;宽度:140px;背景颜色:金色;> - > < 输入 type = button class = button_example value = 提交 / > < / form > < / td > < / tr > < / table > < / div > < / body > < / html > 解决方案 在这里阅读ADO.NET,它会对你有帮助。 看看这些: MSDN:ADO.NET [ ^ ] 简单的ADO.NET数据库使用C#读取,插入,更新和删除。 [ ^ ] I want to submit my html form data to Sql server database or I could send this data to on My Email Id as well........pls tell me i need to do this work......<html><head><style type="text/css">.design{ border:1.5px solid #3267cd; padding:9px; -webkit-border-radius:20px; -moz-border-radius:20px; border-radius: 12px; font-size:15px; font-weight:bold; color: #333; }.button_example{border:1px solid #495267;-webkit-box-shadow: #4C9DB5 0px 2px 2px ;-moz-box-shadow: #4C9DB5 0px 2px 2px ; box-shadow: #4C9DB5 0px 2px 2px ; -webkit-border-radius: 12px; -moz-border-radius: 12px;border-radius: 12px;width:120px;font-size:18px;font-family:arial, helvetica, sans-serif; padding: 5px 5px 5px 5px; text-shadow: 3px 3px 0 rgba(19,20,20,0.3);font-weight:bold; text-align: center; color: #DEF2FF; background-color: 3267cd; background-image: -webkit-gradient(linear, left top, left bottom, from(#abd4f2), to(#3267cd)); background-image: -webkit-linear-gradient(top, #abd4f2, #3267cd); background-image: -moz-linear-gradient(top, #abd4f2, #3267cd); background-image: -ms-linear-gradient(top, #abd4f2, #3267cd); background-image: -o-linear-gradient(top, #abd4f2, #3267cd); background-image: linear-gradient(to bottom, #abd4f2, #3267cd); filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#abd4f2, endColorstr=#3267cd);}.button_example:hover{ border:1px solid #363d4c; background-color: #4B546A; background-image: -webkit-gradient(linear, left top, left bottom, from(#4B546A), top(#2c354b)); background-image: -webkit-linear-gradient(top, #4B546A, #2c354b); background-image: -moz-linear-gradient(top, #4B546A, #2c354b); background-image: -ms-linear-gradient(top, #4B546A, #2c354b); background-image: -o-linear-gradient(top, #4B546A, #2c354b); background-image: linear-gradient(to bottom, #4B546A, #2c354b);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#4B546A, endColorstr=#2c354b);}.button_example1{border:2px solid #495267;-webkit-box-shadow: #4C9DB5 0px 2px 2px ;-moz-box-shadow: #4C9DB5 0px 2px 2px ; box-shadow: #4C9DB5 0px 2px 2px ; -webkit-border-radius: 12px; -moz-border-radius: 12px;border-radius: 5px;width:277px;font-size:29px;font-family:arial, helvetica, sans-serif; padding: 5px 5px 5px 5px; text-shadow: 3px 3px 0 rgba(19,20,20,0.3);font-weight:bold; text-align: center; color: #DEF2FF; background-color:3267cd; background-image: -webkit-gradient(linear, left top, left bottom, from(#abd4f2), to(#3267cd)); background-image: -webkit-linear-gradient(top, #abd4f2, #3267cd); background-image: -moz-linear-gradient(top, #abd4f2, #3267cd); background-image: -ms-linear-gradient(top, #abd4f2, #3267cd); background-image: -o-linear-gradient(top, #abd4f2, #3267cd); background-image: linear-gradient(to bottom, #abd4f2, #3267cd); filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#abd4f2, endColorstr=#3267cd);}<!--.button_example2:hover{ border:1px solid #363d4c; background-color: #4B546A; background-image: -webkit-gradient(linear, left top, left bottom, from(#4B546A), top(#2c354b)); background-image: -webkit-linear-gradient(top, #4B546A, #2c354b); background-image: -moz-linear-gradient(top, #4B546A, #2c354b); background-image: -ms-linear-gradient(top, #4B546A, #2c354b); background-image: -o-linear-gradient(top, #4B546A, #2c354b); background-image: linear-gradient(to bottom, #4B546A, #2c354b);filter:progid:DXImageTransform.Microsoft.gradient(GradientType=0,startColorstr=#4B546A, endColorstr=#2c354b);}--></style><title> Enquiry Form </title></head><body ><div align="center"><table align="center" border="2px" width="22%" bgcolor="BFBABC" style="border-radius:10px 10px 10px"><tr height="60px" ><th><font size="20%" color="silver"><input type="button" class="button_example1" value="Enquiry" /></font></th></tr><tr align="center" style = "padding : 0px" > <td><form ></br><input class="design" type="text" placeholder="Name" size="30%" maxlength="30" style="padding-top:8px; background-color:white"></br></br><input class="design" type="text" placeholder="Course" size="30%" maxlength="30" style="padding-top:8px; background-color:white"></br></br><input class="design" type="text" placeholder="Email" size="30%" maxlength="254" style="padding-top:8px; background-color:white"></br></br><input class="design" type="text" placeholder="Mobile" size="30%" maxlength="10" style="padding-top:8px; background-color:white"></br></br><textarea class="design" name="query_message" cols="26" rows="2" placeholder="Message" maxlength ="300" style="background-color:white"></textarea></br></br><!--<input type="submit" value="Submit" style="height: 35px; width: 140px;background-color:gold;">--><input type="button" class="button_example" value="Submit" /></form></td></tr></table></div></body></html> 解决方案 Read about ADO.NET here and it will help you.Look at these:MSDN: ADO.NET[^]Simple ADO.NET Database Read, Insert, Update and Delete using C#.[^] 这篇关于如何在SQL Server中提交Html表单数据?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!