How do use loop for json
hi,I am stuck in the following code. I need JSON format output. So how to use code for loop using dataset. it is coming output single records
var strNJson = new
{
NCDName,
NCDCode,
Series = new
{
Status = ds.Tables[0].Rows[0]["Status"].ToString(),
NCDBSE = ds.Tables[0].Rows[0]["NCDBSE"].ToString()
}
};
public class CombinedModel
{
public string NCDName { get; set; }
public string NCDCode { get; set; }
public List<SeriesModel> Series { get; set; }
}
public class SeriesModel {
public string Status { get; set; }
public string NCDBSE { get; set; }
}