Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Professionals
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 7th, 2009, 10:40 PM
Registered User
 
Join Date: Jan 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Simple database search example

I am migrating from ASP to ASP.Net, and I'm looking for a simple example of a search page (with 4-5 fields which could be entered by the user), which connects to a database and returns the results of the search. I've done this many times in classic ASP, but it always involved writing all the code by hand.

I've looked pretty extesively at the GridView in ASP 3.5, and obviously it's pretty simple to display records from a database.

What I need the search page to do is the following:

1. On initial display of the page, don't display anything in the GridView (since the user hasn't entered any search criteria yet)

2. When displaying the results of the search, one column returned might be static text in some cases, in other cases it will be a URL to an online document.

3. If the search returns no results (or "hits"), don't display the GridView, but display an "no records found" message. Does the "EmptyDataText" property work in this scenario?

Thanks.
  #2 (permalink)  
Old January 8th, 2009, 02:03 AM
Authorized User
 
Join Date: Dec 2008
Posts: 18
Thanks: 1
Thanked 0 Times in 0 Posts
Default

the grid view shows 'only' when its filled with data from the DB(or u fill with static data ) its not like u want the grid view in ur page load its goind to happen only at the click event.. since the gridview is going to be populated based on the search criteria it wont show anyway... u can use boundfiled for fetching data from DB n for Links use templatefiled n there is something called as EmptyDataTemplate in GV use that when u've no results returned Happy Coding
__________________
Yamini
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Settings to a simple access to a SQL database tedhill Classic ASP Databases 0 July 21st, 2005 04:25 AM
Simple site search jasondavey Dreamweaver (all versions) 4 July 4th, 2005 03:36 PM
simple database problem? juergreh Beginning PHP 3 April 20th, 2005 10:32 AM
Save simple record via web form t sql database kbarsi VB Databases Basics 1 January 30th, 2005 11:29 AM
Simple Database Question Nick.Net VB.NET 2002/2003 Basics 2 December 8th, 2003 05:43 PM



All times are GMT -4. The time now is 10:03 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.