使用数据表和存储过程 [英] Working with DataTable and Stored Procedure

查看:76
本文介绍了使用数据表和存储过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我可以通过调用存储过程和DataTable对象将数据插入数据库中吗,我的意思是,如果我可以使用 SQLCOMMAND.PARAMETER.ADD(...)发送一些值到数据库,在向DataGridView控件插入新行之后,将SP和其他一些使用DataTable的值添加到其中?

Hi, can i insert data into database by calling a stored procedure and a DataTable object , i mean that if i can send some values using SQLCOMMAND.PARAMETER.ADD(...) to the SP and the other some values using DataTable that were added to it after inserting a new row to the DataGridView control ?

推荐答案

您可以将值从数据表中拉出,或者您可以将表转换为XML并使用OpenXML,但我不相信您可以将DataTable作为单个参数传递,不.
You can pull values out of your datatable, or you can turn your table to XML and use OpenXML, but I don''t believe you can pass a DataTable as a single parameter, no.


这篇关于使用数据表和存储过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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