Click here to Skip to main content
15,895,423 members

Comments by satyanand mishra (Top 22 by date)

satyanand mishra 30-Jun-20 11:40am View    
Thank you very Much i did it
satyanand mishra 30-Jun-20 6:46am View    
Deleted
I changed that json to xml but still i get same error
satyanand mishra 29-Jun-20 7:50am View    
Thanks for reply
but it's still give same exception [object:Object]
my Web service code is


using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

namespace JequeryDemo4
{
///
/// Summary description for EmployeeService
///

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
[System.Web.Script.Services.ScriptService]
public class EmployeeService : System.Web.Services.WebService
{

[WebMethod]
public Employee HelloWorld(int employeeId)
{
Employee emp = new Employee();
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["Emp"].ConnectionString);
SqlCommand cmd = new SqlCommand("spGet", con);
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@Id", SqlDbType.Int).Value = employeeId;
con.Open();
SqlDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
emp.Id =Convert.ToInt32(dr["Id"]);
emp.Name = dr["Name"].ToString();
emp.City = dr["City"].ToString();
emp.Salary =Convert.ToInt32(dr["Salary"]);
}
return emp;
}
}
}
satyanand mishra 11-Apr-20 23:40pm View    
I checked everything is fine but It's still give same error the element wev.server has invalid child element
satyanand mishra 11-Apr-20 14:10pm View    
Thanks for Reply I did but it's still give Error in my web Config file
The Element Web.Server has invalid child element rewrite .I am using Visual Studio 10 and IIS 8.5