Did you create the function to split the string on the SQL server that I described and did you modify the stored procedure as I described to make use of the function to split the incoming parameter?
//EDIT
And this is wrong (s starts as an empty string)
string s = "@segment = ";