I get output of string as:
[{"Skey":"5689245","Name":"test19MAY90","PhoneNo":"458652864","Email":"test@gmail.com","ProfilePic":"","Address":"VASHI","City":"mum","State":"Maharashtra","UserArea":null,"AreaId":null,"Landmark":"near station","Latitude":0.000000000,"Longitude":0.000000000,"Addressid":23}]
i want output in following format
{"Skey":"5689245","Name":"test19MAY90","PhoneNo":"458652864","Email":"test@gmail.com","ProfilePic":"","Address":"VASHI","City":"mum","State":"Maharashtra","UserArea":null,"AreaId":null,"Landmark":"near station","Latitude":0.000000000,"Longitude":0.000000000,"Addressid":23}
What I have tried:
if (ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
{
DataTable dt = ds.Tables[0];
List<dictionary><string,>> tableRows = new List<dictionary><string,>>();
Dictionary<string,> row;
foreach (DataRow dr in dt.Rows)
{
row = new Dictionary<string,>();
foreach (DataColumn col in dt.Columns)
{
row.Add(col.ColumnName, dr[col]);
}
tableRows.Add(row);
}
str = serializer.Serialize(tableRows);
str = Regex.Replace(str, "[[]]", " ");