Dear all,
i want create a web service that will send the data and recives the data in json,
when i was create a web service it will autometically tacking soap formatt for post operation please expline me how to pass data in json formatt using sql stored procedures .please help me .
my operation like bellow
[webmethod]
public string savedata(string name,string city,string country ,string pin)
{
sqlconnection conn=new sqlconnection(connection object);
sqlcommand cmd=new sqlcommand("sp_register",conn);
cmd.commandtype=commandtype.stroredprocedure;
cmd.parameters.addwithvalue("@name",name);
cmd.parameters.addwithvalue("@city"city);
cmd.parameters.addwithvalue("@country"country);
string STATUSMSG = (string)cmd.ExecuteScalar();
return new JavaScriptSerializer().Serialize(STATUSMSG);
}
by defalut am getting post operation in soap formatt i need to change it into json please help me