WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-09-2008, 03:00 PM
texxs's Avatar
texxs texxs is offline
WebProWorld Veteran
 

Join Date: Jul 2005
Location: Somewhere in scrub of Florida
Posts: 324
texxs RepRank 0
Default ASP.NET textbox to datagrid lookup

It seems like a very commonly used method to me, yet I can't find a single article or tutorial on it anywhere.

An .aspx page with a textbox and a button. A user types in a value in this textbox and pushes the button.

Then a Datagrid control displays all the rows WHERE (columnName = TypedText).

I've spent about 16 houirs trying to figure this one out and I'm soooooo close, but when the page runs it says there's an "Undefined function 'WHERE' in expression." after I type in a vaild value and click the button.

Here's the code:
Code:
<asp:TextBox ID="TextBox1" runat="server" ToolTip="Type your Inspector ID here"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" /><br />
        <br />
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/weeklyPipe.mdb"
            SelectCommand="SELECT [SRID], [OwnersNameFirst], [OwnersNameLast], [PropertyAddress], [City], [ZipCode], [ContactHomePhone], [ContactWorkPhone], [ContactCellPhone], [InspectorName] FROM [cert_inpGeneralInfo] ORDER BY [InspectorName], [ZipCode], WHERE (InspectorName = ?)">
            <SelectParameters>
                <asp:ControlParameter ControlID="TextBox1" Name="?" PropertyName="Text" Type="String" />
            </SelectParameters>
        </asp:AccessDataSource>
        <br />
    
    </div>
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True"
            DataSourceID="AccessDataSource1" Font-Names="Arial" Font-Size="8pt" PageSize="100">
        </asp:GridView>
(yup, all the column names are spelled 100% correctly.)
__________________
Take a break and watch some stupid video clips

Last edited by texxs : 04-09-2008 at 03:03 PM. Reason: spelling mistakes
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: aspnet, datagrid, lookup



Thread Tools
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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
textbox hieght size... Spectur Web Programming Discussion Forum 2 03-02-2006 12:29 PM
Melissa Data's Hearty Buffet Of Lookup Databases Grows Larg WPW_Feedbot Search Engine Optimization Forum 0 12-12-2005 12:00 PM
Google's Hosting What? Fun With Reverse IP Lookup WPW_Feedbot Search Engine Optimization Forum 0 09-19-2005 02:00 PM
Formatting rows within a Datagrid stonecoldjk Web Programming Discussion Forum 0 06-08-2005 03:10 PM
annoying PHP mySQL textbox problem amorphic8 Web Programming Discussion Forum 2 07-07-2004 04:06 PM


Search Engine Friendly URLs by vBSEO 3.0.0