I am trying to call a webmethod and on the client-side its throwing a 500 error, internal server error.
[WebMethod]
public static List<ChartDetails> GetChartData()
{
using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["#####"].ToString()))
{
List<ChartDetails> dataList = new List<ChartDetails>();
try
{
string sqlStatement = "select top 1000 name, ISNULL([price],0), UploadDate from database_B order by UploadDate desc";
SqlCommand cmd = new SqlCommand(sqlStatement, con);
DataTable dt = new DataTable();
con.Open();
SqlDataAdapter da = new SqlDataAdapter(cmd);
cmd.ExecuteNonQuery();
// dt.Load(cmd.ExecuteReader());
da.Fill(dt);
foreach (DataRow ...
Go to the complete details ...