473,385 Members | 1,817 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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
Oct 23 '07 #1
3 2158
"Simon Gare" <si***@simongare.comwrote in message
news:%2****************@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.
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
Oct 23 '07 #2
"Simon Gare" <si***@simongare.comwrote in message
news:#s**************@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.
http://www.aspfaq.com/5003
Oct 23 '07 #3
Anthony thanks for that will give it a go.

Regards
Simon
Oct 23 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: braindead | last post by:
Hi All Is 1. dopage.asp?<% =SessionID=value_here%> is different tha 2. dopage.asp?<%=SessionID=value_here%> ?? Please note that there is a space between the asp tags and the = sign in the...
11
by: Joey Martin | last post by:
I am passing a sql string thru my querystring for the next page to capture. example: www.xxxxxxxx.com/index.asp?str=select * from table where name like '%doe%' Passing a basic string works...
2
by: Paul Marrero | last post by:
I have an ASP.NET web application that I have written. I just came across this problem as I was loading more "real" data into the system and testing. When I move from page to page, I use an...
12
by: Alex | last post by:
I have a question about determining if one QueryString keys exists. The idea is, if this key exists, than its presence is enough to indicate that its value is true. For example ... ...
6
by: Helter Skelter | last post by:
hi, i want to have a querystring in a webpage. i dont mind what it does (i just want to experiment with it). how do i get the asp.net page to do something when i type in a querystring? if you...
9
by: VancouverMike | last post by:
Hi there, I run into a very strange problem. I got the following url and am passing information via query string. The problem when the "sin" key in query string is blank, shown as in the...
4
by: | last post by:
Hi all, If I am reading this right, then the querystring parameters must be "&amp;" and not "&". However, IIS 6.0 and asp.net request.querystring fails to capture the values if "&amp;" is specified....
6
by: Simon Gare | last post by:
Hi all, is there anyway of separating a string by either a space or + sign, I have an sms.asp page that receives a string in this format below ...
2
by: zman77 | last post by:
I have a problem with HttpRequest.QueryString. There is an XML string that contains something like the following: <age>8+</age> As you probably guessed, the "+" is the problem :) I want to get...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.