Solved

I need to know how to return a dataset from a DB from given a variable paramiter.

Posted on 2004-09-09
2
184 Views
Last Modified: 2010-04-17
I am using asp.vb in Microsofts Visual Web Developer 2005 Express Edition Beta to make a web site.  I have figured out how to graphically put an "SqlDataSource" object on the page and then "Bind" it to various data grids.  The thing works great for returing all the values from my spesified values.  Now I need it to return data based on a text box entry and the click of a button.  I have added my button and my textbox to the page - But I can't figure out how to make the query look at whats in the text box for a parameter then procede to present the results.  I have a basic understanding of ASP.Net (very basic) and of logical syntax.  I can provide further information if it will help.  I just need a little guidance.  Also, for a web application, is this a reasonable way to set up a search for data?  I made the question 500 pts because I think I will need some detail in the answer.  

Thank you,  

-TH
0
Comment
Question by:travishaberman
2 Comments
 
LVL 55

Accepted Solution

by:
Julian Hansen earned 500 total points
ID: 12024670
You need to include some VBScript on the page itself to trap the buttons onclick event.

It's been a while since I did this stuff so my syntax may be a bit off but here is the gist of it.

<intpu type=text  ID="txtQuery" ...>
<input type=button value="click me" onclick="fnSetQuery" ID=button1 ...>

Now you need to create the function

Sub fnSetQuery ()

   myform.mysqlconn.Query = txtQuery.text
   ....
' Do the rest of your data stuff here
end sub
0
 

Author Comment

by:travishaberman
ID: 12029724
Thanks for the help.. !  I actually took your bit here and found a toutorial online that showed me step by step as well..
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question