在gridview中插入数据 [英] data inserting in gridview

查看:75
本文介绍了在gridview中插入数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

我想使用gridview将数据插入数据库中.

hi friends,

i want to insert data into database by using gridview...

推荐答案

gridview不会在任何地方插入数据,而是将其显示出来.取而代之的是,您需要编写一个数据库层,该层使用SQL来插入对网格视图的任何更改或添加.
A gridview does not insert data anywhere, it shows it. Instead, you need to write a database layer, which uses SQL to insert any changes or additions to your gridview.


suhailshai写道:
suhailshai wrote:

使用gridview将数据插入数据库

insert data into database by using gridview



正如CG所说,您不使用gridview来插入数据,可能是您在谈论插入使用gridview显示的数据.
看这里:
MSDN:如何通过使用Visual Basic .NET从DataSet对象更新数据库 [ MSDN:如何通过使用Visual C#.NET中的SqlDataAdapter对象更新SQL Server数据库 [



As CG told, you dont use gridview to insert data, probably you are talking of inserting data that is being shown using a gridview.
Look here:
MSDN: How to update a database from a DataSet object by using Visual Basic .NET[^]
MSDN: How To Update a SQL Server Database by Using the SqlDataAdapter Object in Visual C# .NET[^]


您实际上并没有问题.但我会猜测您要问的内容,并建议您在网格视图中创建页脚模板,以保存将要插入的新"数据行.然后,您可以进行一些事件(例如单击按钮)将该数据保存到数据库中.
You don''t really have a question. But I''ll take a stab at guessing what you are asking and suggest you create a footer template in your grid view to hold the "new" row of data that will be inserted. You can then have some event (e.g., a button click) save that data to the database.


这篇关于在gridview中插入数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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