parameter-passing

SqlDataReader parameter not working

风格不统一 提交于 2019-12-31 07:42:48
问题 I have a windows form that I am asking a user to enter a pcname in textbox1 and then trying to use SqlDataReader to the read from the database to get the pc ipaddress and then map the pc drive to my local pc. But for some reason when I use the textbox within the SQL parameter it's not working. But when I replace the textbox1.text with the actual pcname it works fine. Hopefully someone can help me find out why the parameter isn't working correctly. Here is my code: public void button1_Click

Pass parameter to BLOB object URL

你。 提交于 2019-12-31 02:19:33
问题 Say I've got a reference to a html file as a Blob b and I create a URL for it, url = URL.createObjectURL(b); . This gives me something that looks like blob:http%3A//example.com/a0440b61-4850-4568-b6d1-329bae4a3276 I then tried opening this in an <iframe> with a GET parameter ?foo=bar , but it didn't work. How can I pass the parameter? var html ='<html><head><title>Foo</title></head><body><script>document.body.textContent = window.location.search<\/script></body></html>', b = new Blob([html],

Symfony: pass parameter between actions (with a redirect)

不打扰是莪最后的温柔 提交于 2019-12-30 18:42:06
问题 I am redirecting from one action (executeProcess) to another (executeIndex). I want to be able to pass a parameter/variable along, without using GET (e.g. $this->redirect('index', array('example'=>'true')) ) Is there a way I can directly pass parameters without having it directly displayed in the URL? (e.g. POST). thanks. 回答1: Why dont you use sessions to store values before redirecting, and then getting them on the other action after you redirected? like: class ActionClass1 extendes

Invoking a p:remoteCommand via a JavaScript function passing a message local to that function to another function through the “oncomplete” handler

雨燕双飞 提交于 2019-12-30 12:23:41
问题 This question is purely based on this previously asked question (courtesy) but the question is messed up completely with the Java EE 7 WebSockets API attempting to show the actual practical approach/scenario which is now very unlikely to receive any answer based on <p:remoteCommand> . Given below a snippet of JavaScript (this is only a test scenario). <script type="text/javascript"> function test() { var message = "myMessage"; window["myFunction"](); // This is literally interpreted as a

Want to use a vector as parameter to a function, without having to separate its elements

别说谁变了你拦得住时间么 提交于 2019-12-30 05:12:07
问题 If I call a matlab function with: func(1,2,3,4,5) it works perfectly. But if I do: a=[1,2,3,4,5] %(a[1;2;3;4;5] gives same result) then: func(a) gives me: ??? Error ==> func at 11 Not enough input arguments. Line 11 in func.m is: error(nargchk(5, 6, nargin)); I notice that this works perfectly: func(a(1),a(2),a(3),a(4),a(5)) How can I use the vector 'a' as a parameter to a function? I have another function otherfunc(b) which returns a, and would like to use its output as a paramater like this

Best way of passing callback function parameters in C++

夙愿已清 提交于 2019-12-30 03:57:04
问题 What is the best way of passing a callback function parameter in C++? I thought of simply using templates, like this: template <typename Function> void DoSomething(Function callback) This is the way used e.g. in std::sort for the comparison function object. What about passing using && ? E.g.: template <typename Function> void DoSomething(Function&& callback) What are the pros and cons of those two methods, and why does the STL uses the former e.g. in std::sort ? 回答1: The template <typename

Is there a way to omit out parameter? [duplicate]

送分小仙女□ 提交于 2019-12-30 03:44:23
问题 This question already has answers here : C# 4.0 optional out/ref arguments (9 answers) Closed 6 years ago . Let's assume I have a function with out parameter, however I do not need its value. Is there a way to pass no actual parameter if given result will be thrown away anyway? EDIT: Although the question has been voted to be dupe of Optional Output Parameters it only is if you look from the method creator's perspective. If you're the user of the method, you're interested not in making the

Pass array to ParamArray

…衆ロ難τιáo~ 提交于 2019-12-30 01:53:20
问题 is it possible to pass all elements of an array to a ParamArray? For example I'd like to pass a ParamArray to another ParamArray: Sub test() p1 "test", "banane", "birne" End Sub Sub p1(ParamArray keys() As Variant) p2 keys 'should be the same as: p2 "test", "banane", "birne" End Sub Sub p2(ParamArray keys() As Variant) Dim key As Variant For Each key In keys Debug.Print key 'Run-time error '13' Type mismatch (key is an array) Next key End Sub In this case ParamArray of p2 doesn't contain the

C: Passing variable number of arguments from one function to another

孤街浪徒 提交于 2019-12-30 00:59:28
问题 So, here's a small problem I'm facing right now -> I'm trying to write a function that will accept a char* message and a variable number of arguments. My function will modify the message a little, and then It'll call printf with the message and given parameters. Essentialy, I'm trying to write something like that: void modifyAndPrintMessage(char* message,...){ char* newMessage; //copy message. //Here I'm modifying the newMessage to be printed,and then I'd like to print it. //passed args won't

Send speech recognition args.Result as parameter in UWP desktop-bridge package

余生长醉 提交于 2019-12-29 07:05:02
问题 I'm trying to figure out, if it is possible send using Windows.Media.SpeechRecognition; args.Result.Text as parameter from UWP to Console application. For example by following scenario I'm sending TextToSpeech(args.Result.Text); with args.Result.Text; value, where using Windows.Media.SpeechSynthesis; text-to-speech pronounces the recognition result each time when args.Result.Text; appears. textBlock2.Text = args.Result.Text; also displays result: private async void