|
it
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Querystring issue with the + sign separator
Hi All,
I have a querystring that contains the + sign as a separator, I need to read these values individually in a select statement, for example. &text=Single+205 where single is the type of room somebody wants and 205 is the user ID in the Customer table. Please help. Regards Simon Show quote
"Simon Gare" <si***@simongare.com> wrote in message I include the following for academic reasons.news:%23sFGG0WFIHA.1168@TK2MSFTNGP02.phx.gbl... > Hi All, > > I have a querystring that contains the + sign as a separator, I need to read > these values individually in a select statement, for example. > > &text=Single+205 > > where single is the type of room somebody wants and 205 is the user ID in > the Customer table. > > Please help. > <do not use> The + will be considered an escape character for space hence the code:- Dim sText : sText = Request.QueryString("text") Will put the string "Single 205" in the variable sText. The split function can be used to get the separate values:- Dim asText : asText = Split(sText, " ") Now asText(0) is "Single" and asText(1) is "205" </do not use> However encoding two distinct pieces of data into a single value is not sensible. Better would be:- &type=Single&userid=205 Now the code is:- Dim sType : sType = Request.QueryString("type") Dim lUserID : lUserID = CLng(Request.QueryString("userid") -- Anthony Jones - MVP ASP/ASP.NET "Simon Gare" <si***@simongare.com> wrote in message
http://www.aspfaq.com/5003
news:#sFGG0WFIHA.1168@TK2MSFTNGP02.phx.gbl... > Hi All, > > I have a querystring that contains the + sign as a separator, I need to read > these values individually in a select statement, for example. > > &text=Single+205 > > where single is the type of room somebody wants and 205 is the user ID in > the Customer table. |
|||||||||||||||||||||||