The error is:
Object reference not set to an instance of an object. (See commented line below-------)
I tried using the new keyword and that does not solve the problem.
Do you see the problem?
Private Sub LoadData(ByVal SortKey As String)
Dim strPath As String = Server.MapPath(Request.ApplicationPath)
Dim ds As New DataSet()
ds.ReadXmlSchema(strPath & "\XML\A.xsd")
ds.ReadXml(strPath & "\XML\A.xml")
----------------This line gives the error----------------------------------------
Dim view As DataView = ds.Tables("Orders").DefaultView
--------------------------------------------------------
If Not (SortKey Is Nothing) And SortKey <> [String].Empty Then
view.Sort = SortKey
End If
dgUsers.DataSource = view
dgUsers.DataBind()
End Sub
Object reference not set to an instance of an object. (See commented line below-------)
I tried using the new keyword and that does not solve the problem.
Do you see the problem?
Private Sub LoadData(ByVal SortKey As String)
Dim strPath As String = Server.MapPath(Request.ApplicationPath)
Dim ds As New DataSet()
ds.ReadXmlSchema(strPath & "\XML\A.xsd")
ds.ReadXml(strPath & "\XML\A.xml")
----------------This line gives the error----------------------------------------
Dim view As DataView = ds.Tables("Orders").DefaultView
--------------------------------------------------------
If Not (SortKey Is Nothing) And SortKey <> [String].Empty Then
view.Sort = SortKey
End If
dgUsers.DataSource = view
dgUsers.DataBind()
End Sub