什么是dataadapter填充的手动填充数据和datable之间的区别。 [英] Whats the difference between manually filled datatable and datable filled by dataadapter.

查看:94
本文介绍了什么是dataadapter填充的手动填充数据和datable之间的区别。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,





使用oledb从datatable导出excel,我手动创建了一个数据表,并在其中添加了行并且这个数据表可以插入到excel表中,但是当我使用sqladapter填充数据表时无法完成请帮助。



请参考下面的代码。 />

Hi Friends,


Am using oledb to export excel from datatable, i have created a datatable manually and added rows in it and this datatable can be inserted into the excel sheet,but when i use sqladapter to fill the datatable it cannot be done please help.

Refer the code below.

oledbadap = New OleDb.OleDbDataAdapter()
           oledbadap.InsertCommand = New OleDb.OleDbCommand("INSERT INTO Asciitable([keys],[ascii])values(@keys ,@ascii)", oledcon)
           oledbadap.InsertCommand.Parameters.Add("@keys", OleDbType.Char, 100).Value = "keys"
           oledbadap.InsertCommand.Parameters.Add("@ascii", OleDbType.Char, 50).Value = "ascii"
           oledbadap.Update(dt1, "Asciitable")

推荐答案

请阅读我的评论问题。



手动填充数据表和dataadapter填充数据之间的区别是什么?

没有区别。数据表是数据表,没有别的。
Please, read my comment to the question.

Whats the difference between manually filled datatable and datable filled by dataadapter?
There is no difference. Datatable is datatable and nothing else.


这篇关于什么是dataadapter填充的手动填充数据和datable之间的区别。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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