Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have data in my sql data base and i need to retrieve that data and present that as line charts(visualization) how do i get started with that.
how can i query sql database and return that data to d3.js to draw data visualizations?
Posted
Comments
[no name] 26-Aug-14 7:39am    
Please learn to do a bit of research. There must be millions and millions of examples for you to look at if you bother to search.
Chinna Suresh 27-Aug-14 2:06am    
function getPosts() {
try {

$.ajax({

type: "post",

url: "Service1.asmx/GetPostings",

data: "{}",

contentType: "application/json; charset=utf-8",

dataType: "json",

success: function (response) {

var jposts = response.d;

$('#output').empty();

$.each(jposts, function (index, jpost) {

$('#output').append('<p>Job Posting: ' + jpost.dates + '<br />Job Id: ' +
jpost.value + '<br />Internal/External: ' +



'</p>');

});

},

failure: function (msg) {

$('#output').text(msg);

}

});
}
catch (e) {
alert(1);
}
I Have used this code to return to a asp.net web form but it is not working,
if it returns some data i can embed that data into json object and pass it to d3.js
Chakravarthi Elchuri 27-Aug-14 6:17am    
is your javascript debug line goes into success block, if not please check your GetPosting method in codebhind.
GetPosting method should be like this
[WebMethod]
public static string GetPosting ()
{
return someval;
}


please debug your javascript code with firebug
Chinna Suresh 27-Aug-14 8:25am    
it doesnt have any errors but it is not returing any values ;
how do read all the values which is returned by the web service object,and web service is returning all the results from the sql

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900