473,513 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Query String

1 New Member
I tried to pass the 2 value from by home page in below code to my target page

Expand|Select|Wrap|Line Numbers
  1. Response.Redirect("editclass.aspx?Requestor=" &
  2.        TextBox1.Text & "&Lower= " & lblAllocation.Text)
  3.         Response.Redirect("editclass.aspx?" + TextBox1.Text)
  4.  
  5. on target page i retrived my values like below 
  6. lblejamaatidrequest.Text = Request.QueryString("Requestor")
  7. lblAllocation.Text = Request.QueryString("Lower")
  8.  
both has worked fine but when i tried to search my data using below commands i get nothing what i have done wrong
Expand|Select|Wrap|Line Numbers
  1.  Dim Conn As OleDbConnection
  2.         Conn = New OleDbConnection("Provider=Microsoft.Jet.Oledb.4.0;" & _
  3.                                      "Data Source=d:\student2003.mdb")
  4.         Conn.Open()
  5.  
  6.         Dim DataReader As OleDbDataReader
  7.         Dim Command As OleDbCommand
  8.  
  9.         Command = New OleDbCommand("SELECT Student_Details.[EJamaatID], Student_Details.[FullName], Student_Details.[Sex], Student_Details.[Age], Student_Details.[email], Student_Details.[Mobile],  Student_Details.[Allocation] FROM Student_Details WHERE   Allocation=@Allocation And EJamaatID=@EJamaatID", Conn)
  10.  
  11.         Command.Parameters.Add(New OleDbParameter("@Allocation", lblAllocation.Text))
  12.         Command.Parameters.Add(New OleDbParameter("@EJamaatID", TextBox3.Text))
  13.         Try
  14.             DataReader = Command.ExecuteReader()
  15.             GridView1.DataSource = DataReader
  16.             GridView1.DataBind()
  17.             GridView1.Visible = True
  18.  
  19.         Catch ex As Exception
  20.             MsgBox(Err)
  21.         End Try
  22.         Conn.Close()
Jul 1 '12 #1
1 1871
ariful alam
185 New Member
In first code block you used lblejamaatidrequest.Text and lblAllocation.Text to store your query string value.

In second code block you are using lblAllocation.Text and TextBox3.Text as value for database query parameter.

from where you get the value @ TextBox3.

can you clear this
Jul 5 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1990
by: Andy | last post by:
I haven't done any web work for over a year and for the life of me I cannot remember how to use a query string in a URL. I want the link to be page.aspx?ID=1 then pass 1 into a query like this ...
8
8204
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) {...
1
7118
by: Glenn | last post by:
Searching through google groups, I have not found anyone able to modify the query string of a request. I was hoping to make the query string as short as possible so that a search with many...
3
7434
by: Dr. Oz | last post by:
Hi, I am trying to read in a query string from one page and build a link to another page based on the query string. Here's the code I am using to read in the query string: <script...
10
11663
by: Onur Bozkurt | last post by:
I'am sending some data by the querystring. But I don't want it to be seen exactly because of security reasons. Is there a way to encrypt it and later decrypt when reading the querystring...? I...
9
23689
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...
3
7645
by: Jim Lewis | last post by:
I have read several things that state accessing a Web Service through a Query String should work. However, when I try to execute http://localhost/webservice1/service1.asmx/HelloWorld I get the...
7
2418
by: Thirsty Traveler | last post by:
I have a question regarding the use of guery string variables. I understand this can be a security risk subject to "brute force" attacks. Is this true and, if so, what is the proper way to handle...
0
1277
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi all, I've got a search result web page that is populated dependant on data in the query string. It works fine. However if the user navigates away from the search results page, then...
24
3066
by: MU | last post by:
Hello I have some code that sets a dropdownlist control with a parameter from the querystring. However, when the querystring is empty, I get an error. Here is my code: Protected Sub...
0
7259
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
7380
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
7535
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7098
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...
0
7523
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
4745
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3232
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...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
455
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...

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.