473,671 Members | 2,211 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

trying to pass Request.QuerySt ring 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.QuerySt ring("archiveTy pe"),
it doesn't work. What am I doing wrong?

'SqlSelectComma nd1
'
Me.SqlSelectCom mand1.CommandTe xt = "[myProcedure]"
Me.SqlSelectCom mand1.CommandTy pe = System.Data.Com mandType.Stored Procedure
Me.SqlSelectCom mand1.Connectio n = Me.SqlConnectio n1
Me.SqlSelectCom mand1.Parameter s.Add(New
System.Data.Sql Client.SqlParam eter("@RETURN_V ALUE",
System.Data.Sql DbType.Int, 4, System.Data.Par ameterDirection .ReturnValue,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.Dat aRowVersion.Cur rent, Nothing))
Me.SqlSelectCom mand1.Parameter s.Add(New
System.Data.Sql Client.SqlParam eter("@archiveT ype",
System.Data.Sql DbType.VarChar, 5, System.Data.Par ameterDirection .Input,
False, CType(0, Byte), CType(0, Byte), "",
System.Data.Dat aRowVersion.Cur rent, "all"))

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

Here's the procedure:

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



--
_____
DC G
Jul 21 '05 #1
1 1334
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

Jul 21 '05 #2

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

Similar topics

2
4596
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 advise. Thanks!
5
14034
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 some characters. Can you please kindly share the code segment to workaround how to pass such a long string value to a asp page. This is how I invoke the test page:
4
8372
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 param-value. Putting '?param=xxx' after the websiteName does not indicate exactly which page is receiving the parameter.
5
7817
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 to the Item page "ViewItem.aspx" with a simple : Server.Transfer("ViewItem.aspx"); I'd like to pass another HTTP parameter so that in the "ViewItem.aspx" page,
1
1543
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 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?
1
1499
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 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?
5
2868
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 the parameter submitted from the webform A. how can i do that? greetz Apollo0130
2
4593
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 bound to the catID. This catID (@catID --- an integer) is then to be passed to the next page, sculpture2.aspx for use in a datagrid with a stored procedure.
1
2220
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> <head> <title>New Page 2</title> </head>
0
8393
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8914
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8598
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8670
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7433
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6223
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4224
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2051
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1809
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.