使用单个参数保存多个图像 [英] Multiple image save using single parameter

查看:73
本文介绍了使用单个参数保存多个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

how to save multiple image using single parameter in asp.net web application?
I have to create a store procedure.. bt i want to save multiple image by single parameter.





我尝试了什么:



当我点击保存按钮然后显示sql异常过程或函数sp_ConceptStageImageSave指定的参数太多了。我想解决这个问题。



What I have tried:

When i click save button then show sql exception "Procedure or function sp_ConceptStageImageSave has too many arguments specified." i want to solve this problem.

推荐答案

当你调用存储过程时,你必须传递与你声明的相同数量的参数,除非你指定一个默认值。因此,如果要传递多个值,可以允许(比方说)三个参数,所有NULL默认值,并且只传递一个实际值。你的SP然后检查NULL并适当地对它进行处理。

然而,这不是很灵活。

更好的方法可能是传递一个表值参数: SQL Server 2008和.NET中的表值参数(C# ) [ ^ ]然后通过;它允许您的代码传递(几乎)无限数量的图像。
When you call a stored procedure, you have to pass the same number of parameters as you declared it with, unless you specify a default value. So if you want to pass multiple values, you could allow for (say) three parameters, all NULL default, and only pass one "real" value. Your SP then checks for NULL and hadles it appropriately.
However, that is not very flexible.
A better approach might be to pass a Table Value Parameter: Table Value Parameters in SQL Server 2008 and .NET (C#)[^] and pass that; it allows your code to pass a (virtually) unlimited number of images.


这篇关于使用单个参数保存多个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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