且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在C#中直接使用Gridview将数据插入数据库?

更新时间:2023-10-12 12:17:40

我不知道直接"是什么意思,但是您的网格视图应该只反映数据库中的数据,您应该首先将新数据插入数据库,然后刷新gridview.

如果您是别的意思,或者想问更多,请编辑您的帖子.
I don''t know what you mean by ''directly'', but your grid view should only ever reflect the data in your database, you should insert new data into the database first, THEN refresh the gridview.

If you meant something else, or want to ask more, edit your post.


您在谈论Windows网格或ASP.NET网格时没有提到.

不错,ASP.NET网格允许您为插入行添加新的ItemTemplate.您可以使用它们来添加新行.您还可以使用InsertParameter模板添加自定义参数.

在这里,你去:
ASP.NET GridView-添加新记录 [
You didnt mentioned if you are talking about Windows grid or ASP.NET grid.

Wel, ASP.NET grid allows you to have new ItemTemplate for your insert row. You might use them to add a new row. You can also use InsertParameter template to add your custom parameters.

Here you go :
ASP.NET GridView - Add a new record[^]

;)