检索SqlDataSource SelectParameters值 [英] Retrieve SqlDataSource SelectParameters Value

查看:118
本文介绍了检索SqlDataSource SelectParameters值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要检索SqlDataSource SelectParameter的值。我查看了'sqlSataSourceName.SelectParameters(ParameterName)。'属性列表中可用的属性,但它们都不涉及检索值...您可以获取DefaultValue,但不能获取值。



我想这个值可能会存储在这个sqldatasource正在填充的'GridViewName.DataSource'对象的某处...



有没有办法获得价值?

I need to retrieve the value of an SqlDataSource SelectParameter. I have looked at the properties available in the 'sqlSataSourceName.SelectParameters("ParameterName").' property list, but none of them relate to retrieving the value... you can get the DefaultValue, but not the value.

I suppose it's a possibility that the value may be stored somewhere in the 'GridViewName.DataSource' object that this sqldatasource is populating...

Is there any way of getting the value?

推荐答案







您可以使用数据视图读取sqldatasource中的值。



Hi,


You can use a dataview to read values in your sqldatasource.

DataView testView = (DataView)SqlDataSource1.Select(DataSourceSelectArguments.Empty);
string test = testView[0]["Your Column Name"].ToString();





我希望它有帮助



I hope it helps


看看这里:使用带有SqlDataSource控件的参数 [ ^ ]。在相关页面的底部,您将找到一个示例。
Have a look here: Using Parameters with the SqlDataSource Control[^]. On the bottom of related page, you'll find an example.


这篇关于检索SqlDataSource SelectParameters值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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