Help with Dataview needed..
Hi, I have a object which returns a populated DataSet object from an SQL database.
I can populate a datagrid with all the information by binding the datagrid to the returned information; similiar to this (
Code:
Dim oDataSet as dataset
' Return a dataset from my object
oDataSet = oMyObjectReference.MethodName("markj")
' Bind the retrieved dataset to a datagrid (dgStudentInfo is the name of the datagrid)
dgStudentInfo.DataSource = oDataSet
dgStudentInfo.DataBind()
What I want to do then is filter the rows stored in the DataSet buy using a the filter method of a dataview
I thought I could just go...
Code:
Dim oDataView As DataView
oDataView = oDataSet.Tables("students").DefaultView
When I run this I get an "System.NullReferenceException: Object reference not set to an instance of an object." on the following line;
oDataView = oDataSet.Tables("students").DefaultView
Its seems that I am trying to reference a NULL object..... Also is there a .NET equivalent of the isObject() function??
Thanks for your help
MarkusJ