Judging by the error message, I would say that the variable "plusTable" on
line 93 is Nothing which means that your dataset does not contain a table
called "tblLinks".
"Kathleen Dollard" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> John,
>
> * Line 92: Dim plusView As NEW DataView
>
> (VB will fix the casing )
>
> --
> Kathleen (MVP-VB)
>
>
>
> "John Pether" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Ok I am now using the datview as suggested but get the following error:
> > Exception Details: System.NullReferenceException: Object reference not
set
> > to an instance of an object.
> >
> > Source Error:
> > Line 91: plusTable = myDS.Tables("tblLinks")
> > Line 92: Dim plusView As DataView
> > Line 93: plusView = plusTable.DefaultView
> > Line 94: plusView.RowFilter = "TypeName = Premier Plus"
> > Line 95:
> > Source File: ******\DNSLinks.ascx.vb Line: 93
> > Stack Trace:
> > [NullReferenceException: Object reference not set to an instance of an
> > object.]
> > DNSite.DNSLinks.BindGrid() in ******\DNSLinks.ascx.vb:93
> > DNSite.DNSLinks.Page_Load(Object sender, EventArgs e) in
> > ******\DNSLinks.ascx.vb:76
> > System.Web.UI.Control.OnLoad(EventArgs e) +67
> > System.Web.UI.Control.LoadRecursive() +29
> > System.Web.UI.Control.LoadRecursive() +92
> > System.Web.UI.Control.LoadRecursive() +92
> > System.Web.UI.Control.LoadRecursive() +92
> > System.Web.UI.Page.ProcessRequestMain() +724
> >
> > ---------------------
> > The code is below:
> > ---------------------
> >
> > <code>
> > ' Obtain Link information from Links table
> >
> > Dim links As New DSN.LinksIndexDBbak()
> >
> > Dim myDS As DataSet
> >
> > myDS = links.GetLinks(CatID)
> >
> > ' filter dataset for premier plus links
> >
> > ' and bind to the datalist control
> >
> > Dim plusTable As DataTable
> >
> > plusTable = myDS.Tables("tblLinks")
> >
> > Dim plusView As DataView
> >
> > plusView = plusTable.DefaultView
> >
> > plusView.RowFilter = "TypeName = Premier Plus"
> >
> > plusdl.DataSource = plusView
> >
> > plusdl.DataBind()
> >
> > ' filter dataset for remaining links
> >
> > ' and bind to the datalist control
> >
> > Dim basicTable As DataTable
> >
> > basicTable = myDS.Tables("tblLinks")
> >
> > Dim basicView As DataView
> >
> > basicView = basicTable.DefaultView
> >
> > basicView.RowFilter = "TypeName = Basic, Premier"
> >
> > premierDG.DataSource = plusView
> >
> > premierDG.DataBind()
> >
> >
>
>
|