I have the following sub that is called to load a data grid. It works
without a problem until I uncomment the dv.sort line. When I uncomment
the line I get the error: Object reference not set to an instance of an
object. The error is pointing to that line. What am I doing wrong?
Public Sub LoadGrid()
Dim ds As New Data.DataSet
Dim dv As New Data.DataView
Dim strSQL As String
strSQL ="my sql statement"
ds = DataHandler.GetDataSet(strSQL,
ConfigurationSettings.AppSettings("DataSourceConne ctionString"))
dv = CType(ds, DataSet).Tables(0).DefaultView
HandleSort(SortExpression)
'dv.Sort = Session("Sort").ToString & " " &
Session("SortDirection").ToString
dg.DataSource = dv
dg.DataBind()
lblLegend.Visible = True
End Sub
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!