如何在C#中直接使用Gridview将数据插入数据库? [英] How can I insert data into a database using Gridview Directly in C#?

查看:124
本文介绍了如何在C#中直接使用Gridview将数据插入数据库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果有人可以,请帮助我.谢谢

Please help me if anyone can. Thanks

推荐答案

我不知道直接"是什么意思,但是您的网格视图应该只反映数据库中的数据,您应该首先将新数据插入数据库,然后刷新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[^]

;)


这篇关于如何在C#中直接使用Gridview将数据插入数据库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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