问题描述
我做了这个过程来帮助我重用一个选择查询:
I made this procedure to help me re-use a select query:
如果我希望将所选值放置在文本框中并且它工作正常,我会像这样使用它
And I use it like this if I would want the selected value placed in a textbox and it works fine
但是,如果我希望以这样的字符串传递值:
However if I want the value to be passed in a string like so:
该字符串最终具有一个空字符串值.如何将我查询的值分配给该字符串?
The string ends up having an empty string value. How do I assign the value I queried to that String?
推荐答案
你应该将你的方法修改为一个返回字符串的函数,而不是试图在函数内部分配它.
You should modify your method to be a function returning the string rather than trying to assign it inside the function.
此外,我强烈建议您启用 Option Strict 以获得更好的类型安全性.
Also, I would highly recommend turning on Option Strict to get better type safety.
这篇关于如果参数的数据类型是对象,我如何将查询的值分配给作为过程中的参数的字符串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!