Why Should Use JSON?
- JSON is transportation-independent, you can just bypass the XMLHttpRequest object for getting your data.
- You can get JSON data from anywhere, not just your own domain. There's no more proxy server nonsense.
- JSON parsing is generally faster than XML parsing.
How to call web services through JSON
Step 1
Make web services :
[WebMethod(EnableSession = true)]
public List<string> PageLoadScript(string ProcedureName, string parameter1)
{
string Details = "";
string Pwd = "";
List<string> returndata = new List<string>();
SqlConnection SQLCon = new SqlConnection(ConfigurationManager.ConnectionStrings["PropertyAdvice"].ConnectionString);
try
{
SqlCommand SQLCmd = new SqlCommand();
SQLCmd.Connection = SQLCon;
SQLCmd.CommandText = ProcedureName;
SQLCmd.CommandType = CommandType.StoredProcedure;
SQLCmd.Parameters.AddWithValue("@UserId", parameter1);
SQLCon.Open();
SqlDataReader dr = SQLCmd.ExecuteReader();
if (dr.HasRows == true)
{
while (dr.Read())
{
Details = dr["EmailId"].ToString();
Pwd = dr["Password"].ToString();
}
dr.Close();
}

Ravi ShekharPosted Apr 15, 2013, 2:05 AM
Jquery ajax method only return generics type. It cannot return Datatable or dataset.