When working with Sitecore, it’s common to need content synchronization across environments. Today, I’ll walk you through the steps to sync content from Production to UAT/TEST and vice versa. Steps to Follow 1. Set Up Your Workspace Create a folder on your computer where you will manage the script files and exported data. Open the folder path in PowerShell to begin scripting. We need to run some scripts in PowerShell to update the folder with the basic requirements for syncing content. PS C:\Soft\ContentSync> dotnet new tool-manifest PS C:\Soft\ContentSync> dotnet nuget add source -n Sitecore https://nuget.sitecore.com/resources/v3/index.json PS C:\Soft\ContentSync> dotnet tool install Sitecore.CLI PS C:\Soft\ContentSync> dotnet sitecore cloud login If the above error occurs, you will need to run a different command to resolve the issue. PS C:\Soft\ContentSync> dotnet sitecore init now, Again run above command to open and authenticate with XM Cloud. It will be there a...
Here, I have created properties in GetDetails class and use to get large amount of data which comes from database . see below code i have added lots of data in dataset make loop to add all data in list by help of properties .
This is best to have good programmer. Follow this type of technique to get data.
List<Details > Details = new List<Details >();
if (Ds.Tables[0].Rows.Count > 0)
{
foreach (DataRow dtrow in Ds.Tables[0].Rows)
{
Details user = new GetDetails();
user.RowNumber = dtrow["RowNumber"].ToString();
user.Date = dtrow["Date"].ToString();
user.FromTime = dtrow["FromTime"].ToString();
user.InTime = dtrow["InTime"].ToString();
user.ToTime = dtrow["ToTime"].ToString();
user.OutTime = dtrow["OutTime"].ToString();
Details.Add(user);
}
}
return Details.ToArray();
public class GetDetails
{
public string RowNumber { get; set; }
public string Date { get; set; }
public string FromTime { get; set; }
public string InTime { get; set; }
public string ToTime { get; set; }
public string OutTime { get; set; }
}
Comments
Post a Comment