使用datagridview控件中的数据执行存储过程 [英] Using Data from datagridview control to execute stored procedure

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

问题描述

在我正在创建的程序中,所有存储过程的参数都在datagridview控件中(对于一个特定的存储过程).列为:参数名称,参数类型和类型长度.还有一列名为输入值".用户在此列中输入适合该参数的数据,然后单击运行过程"按钮.单击按钮后,程序必须使用输入值"列的值来执行存储过程.

使用输入到输入值"(Enter Value)列中的数据,程序将执行存储过程.

我不确定如何从datagridview控件中检索信息.

请帮忙.

In the program i am creating, all the stored procedure''s parameters are in a datagridview control (for one specific stored procedure). Columns are: Parameter Name, Parameter Type and Length of Type. There is one more column named "Enter Value". In this column the user enters data appropriate to the parameter and clicks the Run Procedure button. Once the button is clicked the program must use the "Enter Value" column''s value to execute the stored procedure.

Using the data entered into the "Enter Value" column, the program executes the stored procedure.

I''m not sure how to retrieve the information from the datagridview control.

please help.

推荐答案

所以您知道如何填充

So you know how to fill a

DataGridView mDgv;

// Fill mDgv
.
.

// 
int i=3;
// get a value from mDgv, column "MyFill", row 3
int MyFill=mDgv.Rows[i].Cells["MyFill"].Value;



当然,您可以循环获取许多行,也可以获取任何具有的列.



Of course you can loop to get many rows and you can get whatever columns you have.


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

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