473,404 Members | 2,187 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,404 software developers and data experts.

trying to pass Request.QueryString as input parameter

I am trying to pass an input parater to SQL Server. The parameter is a URL
querystring variable. I can't seem to get it to pass a variable, only a
literal value...

Help!

In the following example, the @archiveType parameter accepts the "all"
sample value. If I replace "all" with Request.QueryString("archiveType"),
it doesn't work. What am I doing wrong?

'SqlSelectCommand1
'
Me.SqlSelectCommand1.CommandText = "[myProcedure]"
Me.SqlSelectCommand1.CommandType = System.Data.CommandType.StoredProcedure
Me.SqlSelectCommand1.Connection = Me.SqlConnection1
Me.SqlSelectCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@RETURN_VALUE" ,
System.Data.SqlDbType.Int, 4, System.Data.ParameterDirection.ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, Nothing))
Me.SqlSelectCommand1.Parameters.Add(New
System.Data.SqlClient.SqlParameter("@archiveType",
System.Data.SqlDbType.VarChar, 5, System.Data.ParameterDirection.Input,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.DataRowVersion.Current, "all"))

---------------------------------

Here's the procedure:

CREATE PROCEDURE myProcedure
@archiveType varchar(5)
as
SELECT col1
FROM table1
WHERE col1 = @archiveType



--
_____
DC G
Nov 18 '05 #1
1 1530
DC Gringo

A lot of crossposting however the right newsgroup you just missed in my
opinion.

From the dotnet groups are the SQL guys the most in this newsgroup.

Adonet
news://msnews.microsoft.com/microsof...amework.adonet

Web interface:
http://communities2.microsoft.com/co...amework.adonet

When I see it right you are getting this as result from what you are doing
(not really checking it complete)

select col1 from table1 where col1 = 'all'

I don't believe that this is what you want to archieve, however that you
want
select col1 from table1

However I am not a real SQL one. (Better I hate it)

Cor

Nov 18 '05 #2

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

Similar topics

2
by: Matt | last post by:
How to pass data back and forth between ASP and JSP page? Let's say I have Java objects, how to pass the data back to ASP page?? Or ASP has data, how to pass the data to JSP page?? Please...
5
by: Belinda | last post by:
Hello All I have the following test.asp page which needs one parameter querystr but my querystr is a very long string value. When I send a long value the query string is getting truncated after...
1
by: DC Gringo | last post by:
I am trying to pass an input parater to SQL Server. The parameter is a URL querystring variable. I can't seem to get it to pass a variable, only a literal value... Help! In the following...
4
by: LarryM | last post by:
Hi, A newbie-question: I would like to send in a parameter with the starting link. I suppose I can do this with: 'http://www.mySite.com?param=xxx'. But I cannot figure out how to read that...
5
by: Julien C. | last post by:
Hi all, I have an "EditeItem.aspx" page which lets me edit properties of an "Item". In the OnClick() event of my Save button, I do save Item changes to the database and then I redirect the user...
1
by: DC Gringo | last post by:
I am trying to pass an input parater to SQL Server. The parameter is a URL querystring variable. I can't seem to get it to pass a variable, only a literal value... Help! In the following...
5
by: Apollo0130 | last post by:
hi, i want to pass a parameter (a string) between two forms. i have a Webform A (default.aspx) with a button and a Webform B (detail.aspx). i want to click the button and open the webform B with...
8
by: Angel | last post by:
I am trying to access in Javascript within an ASP.NET web page the Request Object. I am specifically trying to access the values in the Request.QueryString. When I try to access the values I get an...
2
by: Ranginald | last post by:
Hi, I have a repeater based on a stored procedure. It pulls the following: catDesc Image The user sees the category description (catDesc) , and then clicks on the image (Image) which is...
1
by: Josephine | last post by:
HI, Do anyone know how to pass LDAP value from ldap_first.asp and post to value into MS Access Database? Please help. Billion thanks ----------------ldap_first.asp--------------------- <html>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.