DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Wed, 27 Jun 2007 08:51:46 -0600,    posted on: microsoft.public.dotnet.framework.aspnet.datagridcontrol        back       

Thread Index
  1    eagle


gridview with blank rows   
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 
missing:

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



Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
Handles Me.Load
Try
  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
  gridview1.DataBind

  End Sub

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

   Try
    Dim ds as New Data.dataset
    ds = _DL.GetDataSet(qry, bError)
    If bError = False
     return ds
    else
     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
        Try
            SqlDataAccess.FillDataset(_sSQLConn, CommandType.text, qry, ds, 
t)
            If ds.Tables.Count = 0 then
                Throw new exception("No data found")
            else
                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
        Finally
   ds.Dispose()
            ds = Nothing
        End Try
   Return nothing
   End Function
Date:Wed, 27 Jun 2007 08:51:46 -0600   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us