在数据库中插入数据表 [英] insert datatable in Database
本文介绍了在数据库中插入数据表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个数据表,该数据表是由用户在textBoxes中提供的值填充的
..
它创建为
DataTable Dtl =新的DataTable();
现在,我希望一次将这些数据发送[插入]到我的数据库表[Student].我不想使用循环.有什么办法可以做到.
pls help
I am having a datatable that is populated from user supplied values in textBoxes
..
It is Created as
DataTable Dtl=new DataTable();
Now i want this data to be sent[inserted] to my Database table[Student] at one go. i dont want to use loop. is there any way to do so.
pls help
推荐答案
只需将网格的数据源设置为数据库表,并允许用户使用该数据源进行编辑和添加值.由于数据已经连接,因此可以非常轻松地写入数据.看看msdn上的示例:
http://msdn.microsoft.com/en-us/library/1x64c23x.aspx [ ^ ]
祝你好运!
Simply set the datasource of a grid to the database table and let users edit and add values using that. The data can be written very easily because they are already connected. Have a look at the example on msdn:
http://msdn.microsoft.com/en-us/library/1x64c23x.aspx[^]
Good luck!
这篇关于在数据库中插入数据表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文