i have written code in wcf to fetch data from sql database . Following is my code
string SP_STATE = "SP_STATE";
Select selectOBJ = new Select();
DataTable dt = selectOBJ.selectSTATE(SP_STATE);
string jsonData= JsonConvert.SerializeObject(dt);
return jsonData;
i have written code in asp.net to fetch data from wcf post service which is added as a service reference but when i am calling from service ..it is giving me error(Additional information: There was an error deserializing the object of type System.String. End element 'root' from namespace '' expected. Found element 'GetStateListResult' from namespace '')
following is my code
MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(doctorServiceObj.GetStateList()));
STATELISTRESULT objStudent = (STATELISTRESULT)jsonSer.ReadObject(stream);
Response.Write(string.Format("Name = {0} and Address = {1}", objStudent.STATE, objStudent.ROW_ID));
Please Suggest me solution