jQWidgets Forums

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts

  • archana.k
    Participant

    Actually I am using wcf restful service for json data…
    My service code is..
    namespace restsrvc1
    {
    // NOTE: You can use the “Rename” command on the “Refactor” menu to change the interface name “Irestfrchrst” in both code and config file together.
    [ServiceContract]
    public interface Irestfrchrst
    {
    [OperationContract]
    [WebGet(UriTemplate = “GetChartdetails”, ResponseFormat = WebMessageFormat.Json)]

    List<chart> GetChartdetails();
    }
    [DataContract]
    [Serializable]
    public class chart
    {
    [DataMember]
    public int marks { get; set; }
    [DataMember]
    public decimal progress { get; set; }
    }
    }

    namespace restsrvc1
    {
    // NOTE: You can use the “Rename” command on the “Refactor” menu to change the class name “restfrchrst” in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select restfrchrst.svc or restfrchrst.svc.cs at the Solution Explorer and start debugging.
    public class restfrchrst : Irestfrchrst
    {
    SqlConnection con = new SqlConnection(“Data Source=10.90.90.100;Initial Catalog=SGT_Test;User ID=sgtuser;Password=sgtuser”);
    List<chart> c = new List<chart>();
    public List<chart> GetChartdetails()
    {
    con.Open();
    SqlCommand cmd = new SqlCommand(“select * from charts”,con);
    SqlDataReader dr = cmd.ExecuteReader();
    if (dr.HasRows)
    {
    while (dr.Read())
    {
    c.Add(new chart { marks = Convert.ToInt32(dr[0]), progress = Convert.ToDecimal(dr[1]) });
    }
    }
    con.Close();
    return c;
    }

    }
    }
    and the above code is aspx page code…
    Tell me the solution…


    archana.k
    Participant

    I tried that one also but not working…
    Suggest me something..
    When I use my wcf rest service url it is showing error..


    archana.k
    Participant

    please send me the solution as soon as possible…

Viewing 3 posts - 1 through 3 (of 3 total)