c# - How to get Json data in web service without xml and string? -
i'm using angularjs need output data in json format. have tried web service given below getting data database. in wen service i'm getting output xml , string. need without xml , string. here code: [webmethod] public string getdatetimeformats() { datatable dt = new datatable(); string strquery = null; strquery = "sql query"; using (system.data.sqlclient.sqlconnection conn = new system.data.sqlclient.sqlconnection()) { conn.connectionstring = system.configuration.configurationmanager.appsettings["constr"]; using (system.data.sqlclient.sqlcommand cmd = new system.data.sqlclient.sqlcommand()) { cmd.commandtext = strquery; cmd.connection = conn; conn.open(); sqldataadapter da = new sqldataadapter(cmd); da.fill(dt); system.web.script.serialization.javascriptserializer serializer