Hi i want to delete all the information of a sql server table with an ajax function, this is my c# method:
[WebMethod]
public static void deleteCertificado()
{
SqlConnection conn = new
SqlConnection(ConfigurationManager.ConnectionStrings["default"].ToString());
string strsql = "DELETE * FROM Fiel";
SqlCommand comando = new SqlCommand(strsql, conn);
comando.CommandTimeout = 36000;
comando.ExecuteNonQuery();
}
And my JS function:
function testDel() {
if (confirm('Are you sure you want to delete this?')) {
$.ajax({
url: 'Delete.asmx/deleteCertificado',
type: 'Delete',
data: {},
success: function () {
alert("se borrĂ³");
}
});
} else {}
How can i do that? I just want to call the method, my field "data" is empty because i dont have any userid or something like that i just want to DELETE all the info of the table.