Click here to Skip to main content
16,011,784 members

Comments by Rohit Sharma706 (Top 39 by date)

Rohit Sharma706 28-Jun-18 14:23pm View    
Thanks for ur valuable answer, but i already applied as ur given link, But i want as above post, I have DataTable of city and Area, how can i do the code to get as above formate,
---------------------------------
DataSet dsCS = Objbl.Fill_Grid("GetCountryandState", new string[] //Objbl.Fill_Grid("GetArea", new string[]
{
"View"

});



this.Context.Response.ContentType = "application/json; charset=utf-8";
this.Context.Response.Write(GetJSON(dsCS));

-------------------------------------------------------------------------------
public string GetJSON(DataSet ds)
{
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
ArrayList root = new ArrayList();
List<Dictionary<string, object>> table;
Dictionary<string, object> data;

foreach (DataTable dt in ds.Tables)
{
table = new List<Dictionary<string, object>>();
foreach (DataRow dr in dt.Rows)
{
data = new Dictionary<string, object>();
foreach (DataColumn col in dt.Columns)
{
data.Add(col.ColumnName, dr[col]);
}
table.Add(data);
}
root.Add(table);
}

return serializer.Serialize(root);
}
-----------------------------------------------------------------------------
I am using this code but unable to get the above format. So please help me
Rohit Sharma706 15-Dec-15 5:13am View    
thank you very much 4 your reply, but as per you link, that type of dialog box is not appear when i publish the app.
i am working on web application not in website
Rohit Sharma706 24-Dec-13 8:02am View    
With this local ip address i can trace the user in future.
Rohit Sharma706 4-Apr-13 0:54am View    
thank u very much...its work
Rohit Sharma706 17-Dec-12 23:19pm View    
ya u r correct i done it.