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") %>'>
    </asp:TextBox>


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

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lloyd Sheen

    Please help with tutorial or sample

    Lloyd Sheen, Mar 3, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    377
    Lloyd Sheen
    Mar 3, 2004
  2. Jake
    Replies:
    0
    Views:
    728
  3. Rensjuh
    Replies:
    7
    Views:
    1,359
    Mabden
    Sep 2, 2004
  4. Replies:
    1
    Views:
    569
    Valentino Volonghi aka Dialtone
    Jan 6, 2005
  5. jobs
    Replies:
    0
    Views:
    2,305
  6. abargaddon

    Sample code for a server control with templates and databinding ?

    abargaddon, Jan 15, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    785
    abargaddon
    Jan 15, 2008
  7. Earl Teigrob
    Replies:
    1
    Views:
    643
    Shravan
    Mar 1, 2004
  8. Tim Chase
    Replies:
    0
    Views:
    214
    Tim Chase
    Feb 16, 2014
Loading...