I have a keypress variable that is set when a phone call is made to our system. The way it is written in our text file is as follows:
w.Write(attrColl["keypress"].Value);
What I need to do is pass these keystrokes, when they enter, to sproc.
So, my first question is: how to pass it to sproc, the code that I have looks like this:
mySqlCommand.Parameters.Add("@Q1", SqlDbType.Int).Value = keypress;
mySqlCommand.Parameters.Add("@Q2", SqlDbType.Int).Value = keypress;
for example: if the first keystroke is 500 # and the second keystroke is 300 #. it should look like @ Q1 = 500 # and @ Q2 = 300 #
Do I need to convert the keystrokes to a string first? If so, what is the best way to do this, since I have about 10 questions that are given, so I have 10 unique keystrokes that return.
And secondly, since there is a # sign at the end of each keystroke, will the sproc input be nvarchar, not int? Or what is the best way to handle #.
Any thoughts, suggestions or documentation are appreciated.
source
share