? Place the contents of a database field on a page w/o being in a grid, view, etc

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • markpringle
    New Member
    • Jul 2008
    • 5

    ? Place the contents of a database field on a page w/o being in a grid, view, etc

    ASP.NET 3.5 C#
    I very simply want to place the contents of a database field anywhere on a page without adding a bulky gridview, listview, formview, etc on a page? Is this possible? With classic asp you could just do this...
    Code:
    <%=(recordsetname.Fields.Item("databasefield").Value)%>
  • Curtis Rutland
    Recognized Expert Specialist
    • Apr 2008
    • 3264

    #2
    Well, what I like to do is use a Label, and then use my codebehind to select data and then assign said data to the Label's text.

    If you don't know how to use a database in your .NET program codebehind, we have two articles in the Howtos section that you should read.

    Once you understand the concepts in those articles, you can easily apply data from a database to Label, Literal and TextBox controls (as well as many others.)

    Comment

    • markpringle
      New Member
      • Jul 2008
      • 5

      #3
      Originally posted by insertAlias
      Well, what I like to do is use a Label, and then use my codebehind to select data and then assign said data to the Label's text.

      If you don't know how to use a database in your .NET program codebehind, we have two articles in the Howtos section that you should read.

      Once you understand the concepts in those articles, you can easily apply data from a database to Label, Literal and TextBox controls (as well as many others.)
      Can you provide the link to the two articles? I've alwayed used the sqldatasource control to select data and use on a page. I've never selected data in code to use on a page - only accessed data in code to update or delete.

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        Sure.


        Comment

        Working...