A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
AI OnAI Off
A critical vulnerability was discovered in React Server Components (Next.js). Our systems remain protected but we advise to update packages to newest version. Learn More.
string sqlCommandString; sqlCommandString = "SELECT Title, SubTitle, Text FROM tblText"; Database database = DatabaseFactory.CreateDatabase("DefaultConnection"); DbCommand command = lazuriteDatabase.GetSqlStringCommand(sqlCommandString); // Here is the crucial part using (IDataReader reader = lazuriteDatabase.ExecuteReader(command)) { PageType pageType = PageType.Load("Pigment Term"); PageReference parent = new PageReference(5); Global.EPDataFactory.DeleteChildren(parent, true); while (reader.Read()) { PageData newDataPage = Global.EPDataFactory.GetDefaultPageData(parent, pageType.ID); newDataPage.PageName = Convert.ToString(reader["Title"]); newDataPage.Property["Title"].Value = Convert.ToString(reader["Title"]); newDataPage.Property["Subtitle"].Value = Convert.ToString(reader["SubTitle"]); newDataPage.Property["BodyText"].Value = Convert.ToString(reader["Text"]); Global.EPDataFactory.Save(newDataPage, EPiServer.DataAccess.SaveAction.Save); } reader.Close(); }Is there any better way? Maybe if I first create all Pages in PageDataCollection, and after that call Save mathod for each of them it will be faster? Any ideas? Thank's a lot.