473,323 Members | 1,547 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,323 software developers and data experts.

SQL string does not recognize querystrings in c#

I have an sql string in a C# script:
"SELECT d.salesrep_id FROM tblDeal as d WHERE d.orderdate = '" &
request.querystring("boarddate") & "';";

....but I can't use request.querystring because it is vb.net . Is there
a comparable statement in c# that works?
thanks
..NetSports

Nov 17 '05 #1
4 1866
Request.QueryString["boarddate"] should work fine.. or did i
misunderstand ur question?

BTW, the objects in .Net are not bound to a language, only language
features, keywords are (language interoperability).

-----------
Arun Prakash. B

Nov 17 '05 #2
The error i get is:
The type or namespace name 'request' could not be found (are you
missing a using directive or an assembly reference?)

....so for some reason, it doesnt pick up the term "request " as any
type of keyword, class, or object (???)

..netSports

Nov 17 '05 #3
KH
C# is case sensitive -- Request.QueryString["whatever"]

BTW you may want to consider using parameterized queries instead of building
them like that -- Search MSDN and/or Google for SQL Injection Attacks
".Net Sports" wrote:
The error i get is:
The type or namespace name 'request' could not be found (are you
missing a using directive or an assembly reference?)

....so for some reason, it doesnt pick up the term "request " as any
type of keyword, class, or object (???)

..netSports

Nov 17 '05 #4
Use stored procedures and pass them as parameters.

--
info@donotspam dowhileloop.com
http://www.dowhileloop.com web development
http://publicjoe.dowhileloop.com -- C# & VB.NET Tutorials
"KH" <KH@discussions.microsoft.com> wrote in message
news:F9**********************************@microsof t.com...
C# is case sensitive -- Request.QueryString["whatever"]

BTW you may want to consider using parameterized queries instead of building them like that -- Search MSDN and/or Google for SQL Injection Attacks
".Net Sports" wrote:
The error i get is:
The type or namespace name 'request' could not be found (are you
missing a using directive or an assembly reference?)

....so for some reason, it doesnt pick up the term "request " as any
type of keyword, class, or object (???)

..netSports

Nov 17 '05 #5

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

Similar topics

4
by: JA | last post by:
I have this little tell-a-friend script that will send out a link back to the site. I want to put a link on my product pages that will go to the script, and have the script display the product...
9
by: Mark | last post by:
I've run a few simple tests looking at how query string encoding/decoding gets handled in asp.net, and it seems like the situation is even messier than it was in asp... Can't say I think much of the...
6
by: tommaso.gastaldi | last post by:
Hi, does anybody know a speedy analog of IsNumeric() to check for strings/chars. I would like to check if an Object can be treated as a string before using a Cstr(), clearly avoiding the time...
6
by: cthoes | last post by:
following program does the display of student details but i want to search for the particular student name from the added list of student. so it would be great any one can help me without using...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.