将dataGridView单元格保存在数据库中 [英] Save dataGridView Cell in DataBase

查看:103
本文介绍了将dataGridView单元格保存在数据库中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不同的数据库字段中将一列的dataGridView单元格的两个数据插入.例如,列是输入" 输入的每个单元格保存在数据库的不同文件中.

请帮助我(在C#.net中)

Shaphak

How two insert data of dataGridView Cells of one Column in Different database field. For example a Column is "Input" each Cell of Input save in the different filed of database.

Please help me (in C#.net)

Shaphak

推荐答案

如果dataGridView的数据源是dataTable,则最好遍历dataTable的行,获取所需的值,然后
If the data source of your dataGridView is a dataTable, you might as well loop through the rows of your dataTable, get the necessary values you need, and then store it to the database.




Hi,

datgrid.Rows[tempcount].Cells[your cell] can be accessed please go with this.
                            }


,但是在输入"列中,某些单元格是文本框,有些是组合框,此代码不起作用.
but in Input column some cells are textboxes and some are comboboxes this code is not working.


这篇关于将dataGridView单元格保存在数据库中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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