Sample or tutorial on databinding to text control

L

Lloyd Sheen

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
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top