简体   繁体   English

如何将ASP.NET Webform数据写入SQL

[英]How to write ASP.NET webform data to SQL

I am a total beginner of ASP.NET. 我是ASP.NET的初学者。 I have created a webform in Visual Studio and now I need to figure out how to make the webform submit the data to a record in SQL. 我已经在Visual Studio中创建了一个Web表单,现在我需要弄清楚如何使Web表单将数据提交到SQL中的记录。 I assume there are thousands of tutorials out there for this but I can't seem to find any. 我认为这里有成千上万的教程,但是我似乎找不到任何教程。 Everything I find seems wildly over-complicated to just simply write data to a record. 我发现的所有内容似乎都过于复杂,仅将数据写入记录即可。 (or maybe its just my lack of understanding .NET that makes it seem over-complicated.) (或者也许只是我缺乏对.NET的理解,使它看起来过于复杂。)

I dont need to exchange data, or update live data on a page form the db, I just need to write the data to a record. 我不需要交换数据,也不需要更新数据库页面上的实时数据,我只需要将数据写入记录即可。

Can anyone point me in the right direction? 谁能指出我正确的方向?

You could use the scaffolding feature to generate your application. 您可以使用脚手架功能来生成您的应用程序。

All you need to do is setup your connection string (pointing to your database) and follow this tutorial ( http://www.c-sharpcorner.com/UploadFile/4b0136/getting-started-with-web-forms-scaffolding-in-Asp-Net/ ). 您所需要做的就是设置连接字符串(指向数据库),然后按照本教程进行操作( http://www.c-sharpcorner.com/UploadFile/4b0136/getting-started-with-web-forms-scaffolding-in -Asp-Net / )。

As simple as this! 就这么简单!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM