using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

using System.Text;

public partial class DBAccess : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        String searchKey = Request.QueryString["searchKey"];
        if (searchKey.Length > 0)
        {            
            //Do DB search here

            //Return the data fetched from DB as JSON
            StringBuilder strB = new StringBuilder();
            strB.Append("{\"SearchResults\": {\"Rows\": [");
            strB.Append("{\"Value\":\"" + "Falafel Software Inc" + "\"},");
            strB.Append("{\"Value\":\"" + "IBM" + "\"},");
            strB.Append("{\"Value\":\"" + "Microsoft" + "\"},");
            strB.Append("{\"Value\":\"" + "Apple" + "\"},");
            strB.Append("{\"Value\":\"" + "Telerik" + "\"},");
            strB.Append("{\"Value\":\"" + "Cisco" + "\"}");
            strB.Append("]}}");

            Response.Write(strB.ToString());      
          
        }
    }
}
