Kann sein, dass ich v�llig daneben liege, aber ich denke das Problem liegt nicht bei der ArrayList sondern vielmehr bei DataGrid. Matthias, siehe doch nach in Deiner AS*X-Datei, ob dort eine Deklaration ala <asp:DataGrid runat="server" id="ddlBranche"> vorhanden ist. Wenn nicht, dann hast Du den Grund gefunden :)
Gruss Remas http://www.aspalliance.com/remas ----- Original Message ----- From: "matthias zimmerling" <[EMAIL PROTECTED]> To: "aspDEdotnet" <[EMAIL PROTECTED]> Sent: Friday, June 21, 2002 9:47 AM Subject: [aspdedotnet] AW: NullReferenceException > Du deklarierst branchenListe ja zweimal... Hallo Andreas, Danke. Hab ich korrigiert (s.u.) Hat aber leider nichts am Fehler gee�ndert ... Der CodeBehind . . using KiezAssembly; . . . void Page_Load() { string strPageName = "neuer Benutzer"; ArrayList branchenListe = new ArrayList(); KiezUtilities branList = new KiezUtilities(); branList.XmlDropDownList(strPageName, 1, ref branchenListe); // // letzte Zeile f�hrt zu: // System.NullReferenceException: // Object reference not set to an instance of an object. ddlBranche.DataSource = branchenListe; ddlBranche.DataBind(); } Die Klasse in der Assembly: using System; using System.Collections; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Data; using System.Data.OleDb; using System.Web; using System.Web.Mail; using System.Xml; using System.Xml.XPath; namespace KiezAssembly { public class KiezUtilities : Page //HttpContext.Current. { string strPfad; . . . public void XmlDropDownList (string strPageName, byte byteEbene, ref ArrayList branchenListe) { strPfad = Server.MapPath(CreatePath(byteEbene) + "db\\KiezTageskarte.mdb"); XPathDocument objXPathDoc; try { objXPathDoc = new XPathDocument(strPfad); } catch (Exception ex) { divFehlermeldung.InnerHtml = this.Fehlerseite(strPageName, ex.ToString(), 1); pnlFormular.Visible = false; this.SendMail(ex.ToString()); return; } XPathNavigator objXPNav = objXPathDoc.CreateNavigator(); XPathNodeIterator objXPIter; objXPIter = objXPNav.Select("descendant::Branche"); while (objXPIter.MoveNext()) { branchenListe.Add(objXPIter.Current.Value); } } } } | [aspdedotnet] als [EMAIL PROTECTED] subscribed | http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv | Sie k�nnen sich unter folgender URL an- und abmelden: | http://www.dotnetgerman.com/listen/aspDEdotnet.asp | [aspdedotnet] als [email protected] subscribed | http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv | Sie k�nnen sich unter folgender URL an- und abmelden: | http://www.dotnetgerman.com/listen/aspDEdotnet.asp
