I try to return user informations json value at my web page' load method. My code looks like this.
DataSet dsX = ReadSql("select top 14 * from fuyeler where inStatus = 1 and inUye = 1");
if (dsX.Tables.Count > 0)
{
OYUNCU oyuncular = new OYUNCU();
for (int i = 0; i < dsX.Tables[0].Rows.Count; i++)
{
oyuncular.oyuncuID = Convert.ToInt32(dsX.Tables[0].Rows[i]["inID"]);
oyuncular.oyuncuMail = dsX.Tables[0].Rows[i]["stMail"].ToString();
oyuncular.oyuncuPass = dsX.Tables[0].Rows[i]["stPass"].ToString();
oyuncular.oyuncuToken = dsX.Tables[0].Rows[i]["stToken"].ToString();
}
string json = JsonConvert.SerializeObject(oyuncular);
Response.Clear();
Response.ContentType = "application/json; charset=utf-8";
Response.Write(json);
Response.End();
}`
At the end it returns only 1 value of course. I have tried Arrays and lists but JsonConvert.SerializeObject(array or list) doesnt return as json value. It returns every values on 1 row. I want 1 row for 1 value. What should i do about it?
For this code below Json result looks like this,
{"oyuncuMail":"x@gmail.com","oyuncuPass":"x2008","oyuncuToken":"290620153513","oyuncuID":14}