【发布时间】:2016-11-29 13:50:54
【问题描述】:
我正在尝试以编程方式为查询参数添加一个值以报告服务。
List<QueryParameter> lst = new List<QueryParameter>();
QueryParameter qp = new QueryParameter();
qp.Name = "@UserID";
qp.Value = "[@UserID]";
lst.Add(qp);
值被插入,但带有\ 字符,是因为@。我的 QueryParameter 值应该类似于 [@UserID],而是显示为 \[@UserID\]。
如何从值中删除\,并且在调试时\ 不显示。
非常感谢任何建议。
更新1:
【问题讨论】:
-
插入的值在哪里,在哪里显示为
\[@UserID\]? -
@TimSchmelter - 更新了我的帖子。当我打开我的 rdl 并检查参数时,值会显示为图片中提到的那样。
-
@RahulHendawe -
qp.value是QueryParameter,它没有拆分方法。 -
是的,试试这个:
string requestPath = qp.Value;string[] requestPathParts = requestPath.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries); -
@RahulHendawe - 我仍然能够看到
`. Is it getting created internally somewhere or because of@? But I'm sure it's because of[@` 组合。
标签: c# asp.net .net reporting-services