Solved

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

Posted on 2004-09-09
2
182 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 52

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Here we come across an interesting topic of coding guidelines while designing automation test scripts. The scope of this article will not be limited to QTP but to an overall extent of using VB Scripting for automation projects. Introduction Now…
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

914 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now