如何将值插入数据库?

时间:2022-11-26 15:42:44

I have taken some text field and abd some labels and one submit and one reset button. I want to code like: when i enter some values in text boxes and click upon submit my record will get submitted into the database. And when i click upon reset then my form will get reset.

我已经采取了一些文本字段和abd一些标签和一个提交和一个重置按钮。我想代码如下:当我在文本框中输入一些值并单击提交时,我的记录将被提交到数据库中。当我点击重置时,我的表单将被重置。

Please let me know how will i code this scenario.

请让我知道我将如何编码这种情况。

Thanks,

Ashish

2 个解决方案

#1


5  

With due respect, this question is rather broad and you would likely be better served by doing a bit of searching for some base knowledge about the tasks that you are looking to perform.

在充分尊重的情况下,这个问题相当广泛,您可能会通过搜索有关您要执行的任务的一些基础知识来获得更好的服务。

I would suggest that you begin by going to your favorite search engine and querying for:

我建议你先去你最喜欢的搜索引擎并查询:

  • HTML Forms
  • Insert data into a database
  • 将数据插入数据库

  • ASP.NET Tutorials

Once you have a grasp of the basic technologies that you're using, you should find that it is far easier to accomplish your task. If, by chance, you run into any specific problems or issues, then this would be a great place to ask questions related to them. Best of luck.

一旦掌握了所使用的基本技术,就会发现完成任务要容易得多。如果您偶然遇到任何特定问题或问题,那么这将是一个提问相关问题的好地方。祝你好运。

#2


0  

asp.net and databases http://www.asp101.com/samples/db_add.asp

asp.net和数据库http://www.asp101.com/samples/db_add.asp

resetting the forms http://www.java2s.com/Code/ASP/Asp-Control/Resettheform.htm

重置表单http://www.java2s.com/Code/ASP/Asp-Control/Resettheform.htm

you should try using google first. these examples came up on top for simple queries like

你应该先尝试使用谷歌。这些例子出现在简单查询之上

asp.net databases

and

asp.net reset forms

that said you have not really provided enough information to garner a useful answer. what database are you using, what version of asp.net (are you even using it, or did you click the tag by accident - you dont mention it in your post), what platform - specifically?

那说你还没有真正提供足够的信息来获得有用的答案。您使用的是什么数据库,什么版本的asp.net(你甚至使用它,或者你偶然点击了标签 - 你在帖子中没有提到它),具体是什么平台?

#1


5  

With due respect, this question is rather broad and you would likely be better served by doing a bit of searching for some base knowledge about the tasks that you are looking to perform.

在充分尊重的情况下,这个问题相当广泛,您可能会通过搜索有关您要执行的任务的一些基础知识来获得更好的服务。

I would suggest that you begin by going to your favorite search engine and querying for:

我建议你先去你最喜欢的搜索引擎并查询:

  • HTML Forms
  • Insert data into a database
  • 将数据插入数据库

  • ASP.NET Tutorials

Once you have a grasp of the basic technologies that you're using, you should find that it is far easier to accomplish your task. If, by chance, you run into any specific problems or issues, then this would be a great place to ask questions related to them. Best of luck.

一旦掌握了所使用的基本技术,就会发现完成任务要容易得多。如果您偶然遇到任何特定问题或问题,那么这将是一个提问相关问题的好地方。祝你好运。

#2


0  

asp.net and databases http://www.asp101.com/samples/db_add.asp

asp.net和数据库http://www.asp101.com/samples/db_add.asp

resetting the forms http://www.java2s.com/Code/ASP/Asp-Control/Resettheform.htm

重置表单http://www.java2s.com/Code/ASP/Asp-Control/Resettheform.htm

you should try using google first. these examples came up on top for simple queries like

你应该先尝试使用谷歌。这些例子出现在简单查询之上

asp.net databases

and

asp.net reset forms

that said you have not really provided enough information to garner a useful answer. what database are you using, what version of asp.net (are you even using it, or did you click the tag by accident - you dont mention it in your post), what platform - specifically?

那说你还没有真正提供足够的信息来获得有用的答案。您使用的是什么数据库,什么版本的asp.net(你甚至使用它,或者你偶然点击了标签 - 你在帖子中没有提到它),具体是什么平台?