jQWidgets Forums
Forum Replies Created
-
Author
-
February 5, 2014 at 10:27 am in reply to: How to bind the json data through wcf rest service for jqxlinechart? How to bind the json data through wcf rest service for jqxlinechart? #49003
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…February 5, 2014 at 10:04 am in reply to: How to bind the json data through wcf rest service for jqxlinechart? How to bind the json data through wcf rest service for jqxlinechart? #49000I tried that one also but not working…
Suggest me something..
When I use my wcf rest service url it is showing error..February 5, 2014 at 6:48 am in reply to: How to bind the json data through wcf rest service for jqxlinechart? How to bind the json data through wcf rest service for jqxlinechart? #48978please send me the solution as soon as possible…
-
AuthorPosts