473,672 Members | 2,588 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 1881
ariful alam
185 New Member
In first code block you used lblejamaatidreq uest.Text and lblAllocation.T ext to store your query string value.

In second code block you are using lblAllocation.T ext 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
2003
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 select * from table where id = "query string value" I know it's simple, I just haven't done it for a long time. Can somebody please help me out? Thanks
8
8219
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) { document.location.href = document.location.href.substring(0, document.location.href.indexOf('#')) + '?' + newUrl; } else { document.location.href = document.location.href + '?' + newUrl; }
1
7129
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 criteria could be bookmarked. I had planned to have the query string be key=value for each criteria But with dropdowns, the default choice is always submitted. There were other parameters that I had to use that were longer than I hoped. And...
3
7446
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 "text/javascript"> function getQueryVariable(variable) { var query = window.location.search.substring(1);
10
11681
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 would be very happy with some sample code.
9
23700
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 "improvements", but maybe someone here can point me in the right direction... First, it looks like asp.net will automatically read and recognize query strings encoded in utf8 and 16-bit unicode, only the latter is some mutant, non-standard...
3
7663
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 error below. Can I access a Web Service through a Query Sting. I need to send XML to a Flash movie using a Web Service. Thank You, Jim Lewis Server Error in '/WebService1' Application.
7
2422
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 it? Should they never be used?
0
1282
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 navigates back to it, even though the query string looks exactly the same in the address bar, the query string results are different. Here's an example of the query string when first navigating to the page:
24
3089
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 Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load If Not Page.IsPostBack Then
0
8486
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8828
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8608
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
8680
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
7446
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...
0
5705
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4418
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2819
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1816
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.