GridView Data Binding

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ahling
    New Member
    • Jan 2009
    • 7

    GridView Data Binding

    Hi again.

    I have questions to ask.

    1. It's not necessary that I write codes to bind the database to the gridview?

    2. Why is it that when I try to view the gridview in the browser it shows me a blank page? How to overcome that? Write codes...? If it is true that we have to include codes, how to code? Because currently there is no data in the database for the gridview and when I attempt to view it, it gives me a blank page.


    Thanks.
  • Bassem
    Contributor
    • Dec 2008
    • 344

    #2
    Yes, because there are no rows in your database, it gives a blank page.
    Insert a row or more in your database using the database management system IDE, if it SQL Server so use the management studio SSMS or Visual Studio to do so, and you can type an insert statement to your database.

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      If you don't use the DataBind method to bind the data to your GridView then your GridView will contain no data to display and therefore will not be displayed.

      Once you have created a data source for your GridView set the GridView's DataSource Property and the call the GridView's DataBind method to bind this data to the GridView. If the source contains data then your GridView will be displayed in the page, otherwise it will not be displayed.

      Comment

      • sangam56
        New Member
        • Nov 2007
        • 68

        #4
        Display gridview header when no data is present

        Check out this:Display gridview header when no data is present.
        This post suggests the way to display gridview header when there is no data present in the gridview.

        Comment

        Working...