473,378 Members | 1,410 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,378 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 21 '05 #1
1 1206
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 21 '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>...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
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.