gridview with blank rows

Discussion in 'ASP .Net Datagrid Control' started by eagle, Jun 27, 2007.

  1. eagle

    eagle Guest

    I have a gridview that I am binding dynamically, and the gridview does have
    records in it but they are all blank except for the "Select". What am I

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="true">

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
    Handles Me.Load
    Call BindGrid
    catch ex as exception
    Message.innerhtml = "Error!"
    end try
    End Sub
    private Sub BindGrid
    Dim bError as Boolean
    Dim ds as data.dataset = nothing
    Dim qry as String
    qry = "myStoredProcedure"
    ds = _BL.GetDataSet(qry, bError)

    gridview1.DataSource = ds

    End Sub

    Public Function GetDataSet(ByVal qry As String, Optional ByRef bError as
    Boolean=False) As Dataset

    Dim ds as New Data.dataset
    ds = _DL.GetDataSet(qry, bError)
    If bError = False
    return ds
    return nothing
    End If
    Catch ex As Exception
    Throw New Exception("GetDataSet Error: " & ex.Message)
    End Try
    End Function

    Public Function GetDataSet(ByVal qry As String, Optional ByRef boolError
    as Boolean=False) As Dataset

    boolError = False
    Dim t(0) as string
    t(0) = "myTable"

    Dim ds as new DataSet
    SqlDataAccess.FillDataset(_sSQLConn, CommandType.text, qry, ds,
    If ds.Tables.Count = 0 then
    Throw new exception("No data found")
    Dim dt As DataTable = ds.Tables(0)
    If dt.Rows.Count = 0 Then
    Throw new exception("No data found")
    End If
    Return ds
    end if
    Catch ex as Exception
    Throw new exception("No data found")
    Exit Try
    ds = Nothing
    End Try
    Return nothing
    End Function
    eagle, Jun 27, 2007
    1. Advertisements

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