Greetings, I have a page where I put in all of my links the links are in the acces db as follow: table links: |id|categorie|linknaam|linkurl| Now I have like 4 links in the catagorie School, But when I display it on the page I see the links like this: School
link 1 School link 2 School link 3 School link 4 Other catagorie link 1 Other catagorie link 2 now, I want it to be showed like this: School link1 link2 link3 link4 Other catagorie link 1 link 2 I got this source: <script runat="server"> public void Page_Load(Object
sender,EventArgs e) { try { string Categorie=""; OleDbConnection db_locatie = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath(".") + ConfigurationSettings.AppSettings["Database_Locatie"]); OleDbDataAdapter mijnAdapter =
new OleDbDataAdapter("SELECT * FROM links ORDER BY categorie, linknaam ASC" ,db_locatie); DataSet ds=new DataSet(); DataRow Rs=new DataRow(); db_locatie.Open(); mijnAdapter.Fill(ds,"links"); AdminRepeater.DataSource = ds.Tables["links"].DefaultView; AdminRepeater.DataBind();
while (!Rs) { if (Rs("categorie")!=categorie) { groep=Rs("categorie"); Response.write (Rs("linknaam")); } Rs.MoveNext; } db_locatie.Close(); } catch (OleDbException ex) { error.Text = "Er ging iets fout bij het connecten met de database, probeer het a.u.b.
opnieuw."; } } </script> <form runat="server"> Links
</form> But it only displayes the following error: Compiler Error Message: CS1501: No overload for method 'DataRow' takes '0' arguments Source Error: Line 13: Line 14: DataSet ds=new DataSet(); Line 15: DataRow Rs=new DataRow(); Line 16: Line 17: db_locatie.Open();
I dont get this error (I am just a n00b :(). Tnx for the answer. Greetz, Stefan
AthlonPower
Member
235 Points
47 Posts
Problem grouping links (C# , Acces db)
Sep 01, 2003 06:57 PM|LINK
</form> But it only displayes the following error: Compiler Error Message: CS1501: No overload for method 'DataRow' takes '0' arguments Source Error: Line 13: Line 14: DataSet ds=new DataSet(); Line 15: DataRow Rs=new DataRow(); Line 16: Line 17: db_locatie.Open(); I dont get this error (I am just a n00b :(). Tnx for the answer. Greetz, Stefan