Hi.
I have a Query string from client application. It comes with all parameters like
string query="PROCS.DBO.APP_2370_ANALYST_S 'ABC' , 'TESTDATA' , 100";
In Server, I made a function(Util.getParametersFromString) to parse string from client application to make parameter object Array using string.Split function. I used ',' and ' ' as separator to make object array.
And I execute db procedure by using below code
object[] parameters = Util.getParametersFromString(query);
DbCommand cmd = dbconnection.GetStoredProcCommand("PROCS.DBO.APP_2370_ANALYST_S", parameters);
I works well if parameter string doesn't contain comma or single quotation mark. If one of parameter string have one or more comma or single quotaion mark. Like below
string query="PROCS.DBO.APP_2370_ANALYST_S 'A,B,C' , 'Hi, Sam 'The Legend' Brown was here ' , 100";
parameter array didn't come correctly. I didn't know how to parse string correctly in this
situation. Please give me advice to solve this problem
I am not good at english. So I am so sorry If I didn't write my question correctly
Regards, Park