//This is my code and i want to pass api with array name please give me the answer
protected void Page_Load(object sender, EventArgs e)
{IsTrue = 0;
if (string.IsNullOrEmpty(Request.QueryString["Username"]) == false && string.IsNullOrEmpty(Request.QueryString["Password"]) == false)
{
IsTrue = 1;
}
if (IsTrue > 0)
{
DataTable dt = new DataTable();
UserName = Request.QueryString["UserName"];
Password = Request.QueryString["Password"];
con.Open();
dt.Load(new SqlCommand("select Top 10 Memberid,MemberName from PartyMaster Order by msrno", con).ExecuteReader());
con.Close();
System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
List
Dictionary
foreach (DataRow dr in dt.Rows)
{
row = new Dictionary
foreach (DataColumn col in dt.Columns)
{
row.Add(col.ColumnName, dr[col]);
}
rows.Add(row);
}
//string Mystr = serializer.Serialize(rows);
string Mystr = serializer.Serialize(rows);
Response.ContentType = "application/json"; //JSON Text output
Response.Write(Mystr);
}

Replies
Know the answer? Post it — somebody with the same question will find it here.