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. Advertising

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. Jake
    Replies:
    0
    Views:
    547
  2. abargaddon

    Sample code for a server control with templates and databinding ?

    abargaddon, Jan 15, 2008, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    714
    abargaddon
    Jan 15, 2008
  3. Tim Chase
    Replies:
    0
    Views:
    70
    Tim Chase
    Feb 16, 2014
  4. Terry Reedy
    Replies:
    0
    Views:
    78
    Terry Reedy
    Feb 16, 2014
  5. Tim Chase
    Replies:
    0
    Views:
    83
    Tim Chase
    Feb 16, 2014
Loading...

Share This Page