Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > gridview with blank rows

Reply
Thread Tools

gridview with blank rows

 
 
eagle
Guest
Posts: n/a
 
      06-27-2007
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide the Gridview Rows and Header rows in Button click VijayRama ASP .Net 2 10-12-2009 01:58 PM
Gridview returns old value of gridview.rows.count! MC ASP .Net 2 12-12-2008 11:15 PM
blank CD-R and blank DVD-R not recognized by Vista 64 Ultimate =?Utf-8?B?R3JlZyBLaXJrcGF0cmljaw==?= Windows 64bit 13 11-07-2007 12:23 PM
GRIDVIEW: Effecting buttonfields on single gridview rows =?Utf-8?B?TWFya0F1cml0?= ASP .Net 0 05-23-2006 08:11 PM
Gridview returns old value of gridview.rows.count! MC ASP .Net Datagrid Control 1 04-26-2006 01:51 PM



Advertisments