Sample or tutorial on databinding to text control

Discussion in 'ASP .Net' started by Lloyd Sheen, Mar 3, 2004.

  1. Lloyd Sheen

    Lloyd Sheen Guest

    I think this should be simple but I need a sample of binding the results of
    a sql query to textboxes. I have seen the MSDN sample and all attempts to
    make it work have failed. When I attempt to do the DataBind it fails with a
    message "Index 0 is not non-negative and below total rows count".

    I am just trying to access the Territories table in Northwind as a sample.
    (Actual app will have about 40 fields).

    The HTML code for the textbox is :
    <asp:TextBox id=TextBox1
    style="Z-INDEX: 101; LEFT: 123px; POSITION: absolute; TOP: 63px"
    runat="server" Width="200px" Height="25px" Text='<%#
    DataBinder.Eval(Terrs1, "Tables[Territories].DefaultView.[0].RegionID") %>'>

    Lloyd Sheen
    Lloyd Sheen, Mar 3, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.