Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use database data without data bound controls

    In asp.net 2, is it possible to use a data source control, such as a SQLDataSource, and have data from the database displayed in an asp textbox without having to use one of the data bound controls (GridView, DetailsView etc.)? In the old days (not net asp) you could create a recordset and then use something like <%= rst(

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Use database data without data bound controls

    Hi Ian,

    You'll want to use the syntax: <%#DataBinder.Eval(Container.DataItem, "<fieldname>") %>

    This is used in conjunction with a repeating data control - such as a Repeater, DataGrid, or GridView.

    I haven't spent much time with .NET 2.0 and I think there's a new, simplified syntax for this. At least this should give you some direction for continued research.

    Hope this helps!

  3. #3
    3 Star Lounger
    Join Date
    Sep 2002
    Location
    London, England
    Posts
    294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Use database data without data bound controls

    Thanks. I've decidied to use the FormView cintrol, which looks to be more customisable than some of the others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •