Home > Ask the Microsoft .Net Development Experts > .NET Development with XML Questions & Answers > Need an ASP.NET page with a text box and submit button to pull records
Ask The Win Development Expert: Questions & Answers
EMAIL THIS

Need an ASP.NET page with a text box and submit button to pull records

Daniel Cazzulino EXPERT RESPONSE FROM: Daniel Cazzulino

Pose a Question
Other Win Development Categories
Meet all Win Development Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 08 June 2004
I'm fairly new to the VS world and am looking to create to a simple search in an Access 2000 database, using ADO.NET. The database has a simple employee information table. Fields are SS#, Lastname, Firstname, etc. What I would like to do is create an ASP.NET page with a text box and submit button that a user can put their SS# into, hit submit and it returns a single record that corresponds to the SS# inputted by the user. SS# happens to be the primary key in the database. I can return all records fine using an OleDbDataAdapter and a DataSet. Just need a little help with the SQL statement to return only the records that match the SS#. Thanks!
Platform: WinXP Pro

>
If you're using the OleDbDataAdapter, most probably you have drag&dropped it in a form. Right-click it and select Configure Data Adapter. In the dialog for the SQL statement, enter something like the following:
SELECT * FROM Employees WHERE SSN=@SSN
The code to fill the dataset should be:
oleDbDataAdapter1.SelectCommand.Parameters.Add("@SSN", this.txtSSN.Text); oleDbDataAdapter1.Fill(dataSet1);

This way you're passing the SSN parameter to the query before filling the dataset.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
XML and Data
Modifying XML rows using XSL sheets
Generating Access data as XML for HTML publishing
Editing datagrids, take two
Creating applications to access data via mobile phones
Is it possible to schedule SQLs written for a paradox database?
Questions regarding XML for a decision making tool
Extracting data from Word 6 to populate database
How can I make a connection to a Paradox password protected database?
I have an Access Database that I want to display in a Listview.
Problem with Paradox Connection String

.NET Development with XML
Modifying XML rows using XSL sheets
Generating Access data as XML for HTML publishing
Editing datagrids, take two
Creating applications to access data via mobile phones
Is it possible to schedule SQLs written for a paradox database?
Questions regarding XML for a decision making tool
Extracting data from Word 6 to populate database
How can I make a connection to a Paradox password protected database?
I have an Access Database that I want to display in a Listview.
Problem with Paradox Connection String

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Windows Development - White Papers, News and Expert Advice
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts