Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Querystring issue with the + sign separator

Reply
Thread Tools

Querystring issue with the + sign separator

 
 
Simon Gare
Guest
Posts: n/a
 
      10-23-2007
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


 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      10-23-2007
"Simon Gare" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> 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.
>


I include the following for academic reasons.

<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


 
Reply With Quote
 
 
 
 
Simon Gare
Guest
Posts: n/a
 
      10-23-2007
Anthony thanks for that will give it a go.

Regards
Simon


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Handle # sign in url/querystring David C ASP .Net 2 04-07-2008 03:30 PM
$ sign to gb pound sign PWB Computer Support 6 02-19-2007 03:06 AM
Automatic sign-up and sign-in across different domains without cookies? Jimmy ASP .Net 1 11-21-2006 04:41 PM
Automatic sign-up and sign-in between different domains without cookies? Jimmy Javascript 3 11-20-2006 01:28 PM
J sign instead of ? sign Harold Potter esq. Computer Support 5 04-16-2005 02:19 PM



Advertisments