使用.net通过存储过程进行迭代插入 [英] Itterative insertion by stored procedure using .net

查看:80
本文介绍了使用.net通过存储过程进行迭代插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,

我的项目基于三层体系结构,我正在使用存储过程来插入,删除和更新数据.使用包含两列(X,Y)的表的项目:
我必须使用存储过程一次插入四行,每次插入时具有不同的值.我现在在C#.net中创建了属性array [],如何从前端传递这些数组值并在存储过程中进行接收.


预先感谢,

Sudhir Srivastava

dear all,

my project is based on three tier architecture i am using stored procedure to insert, delete and update the data. project using a table that contains two columns(X,Y) :
i have to insert four rows at a time with different value on single insert using stored procedure. i have created property array[] in C#.net now how to pass these array values from front end and receive in stored procedure.


Thanks in advance,

Sudhir Srivastava

推荐答案

请看以下支持文章.它建议如何将数组传递给sql server存储过程.

如何使用XML和Visual Basic .NET将值数组传递到SQL Server存储过程中 [
Take a look at the following support article. It suggest how to pass array to sql server stored procedure.

How to pass array of values into SQL Server stored procedure using XML and Visual Basic .NET[^]

Other alternate is to have a usual stored procedure. Initilize the command object with the stored procedure parameter. You can call execute in a loop setting the parameter values each time. This based on the requirements should be in the scope of a single transaction.


这篇关于使用.net通过存储过程进行迭代插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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