使用C#从存储过程中检索参数命名和值类型 [英] Retrieving parameter namd and value type from stored procedure using c#

查看:130
本文介绍了使用C#从存储过程中检索参数命名和值类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我正在创建的程序中,我需要检索参数名称和参数的值类型以及值类型的长度.我需要从代码的不同部分获取的特定存储过程中检索参数.

我需要将所有参数名称,值类型和类型长度加载到datagridview中. datagridview已经有4列:参数名称,类型名称,长度和输入值. 输入值"列允许用户输入一个值,该值用于显示存储过程的结果

我正在使用SQL Server 2008和Visual Studio2010.

请帮助

in the program i am creating i need to retrieve the parameter name and value type of the parameter and length of the value type. i need to retrieve the parameters from a specific stored procedure that i have acquired in a different part of my code.

i need to load all parameter names, value types and type lengths into a datagridview. the datagridview already has 4 columns: Parameter name, Type name, Length and Enter Value. The ''enter value'' column allows the user to enter a value to be used to display the results of the stored procedure

i am using SQL Server 2008 and Visual Studio 2010.

please help

推荐答案

查看此处:
Look here: http://www.mssqltips.com/sqlservertip/1669/generate-a-parameter-list-for-all-sql-server-stored-procedures-and-functions/[^]. This is not exactly what you need, but a little upgrade will help. You just have to filter it and process the results in your application. It is working in SQL 2008 as well.


这篇关于使用C#从存储过程中检索参数命名和值类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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