views:

68

answers:

2

this code never fills the grid view I know that somthing is wrong here the code

Imports System.Data
Imports ZidduDataSetTableAdapters
Partial Class _Default
    Inherits System.Web.UI.Page
    Dim filesAdp As New FilesTableAdapter
    Dim filestable As New ZidduDataSet.FilesDataTable
    Protected Sub btnfill_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnfill.Click
        Me.GridView1.DataSource = filesAdp.GetData
        Me.GridView1.DataBind()
    End Sub
End Class

and I already created the dataset with wizard called ZidduDataSet.xsd and the adapter name is FilesTableAdapter

can any one help?

+1  A: 

i am not a VB coder, but i think you should call Databind() function on Page Load event too.

hope this helps.

A: 

the only thing wrong with the code is that filestable is never used. If your gridview isn't showing up then you have a problem else where i think.

  1. btnfill_Click isn't getting called. Check the .aspx markup to make sure the event handler is referenced.
  2. filesAdp.GetData doesn't return any data.
  3. GridView1 isn't visible on the page.
Al W