数据表Ajax调用

I am trying to fetch data from database through Jquery DataTable and it gives error as:

"DataTables warning: table id=tblBindData - Cannot reinitialise DataTable."

function BindData() {

    $("#tblBindData").DataTable({
        "processing": true,
        "serverSide": true,
        "sAjaxSource": "FirstTask.aspx/PopulateDatatable",
        "fnServerData": function (sSource, aoData, fnCallback) {
            aoData.push({});
            $.ajax({
                "dataType": 'json',
                "contentType": "application/json; charset=utf-8",
                "type": "POST",
                "url": sSource,
                "data": aoData,
                "success": function (msg) {
                    var json = jQuery.parseJSON(msg.d);
                    fnCallback(json);
                    $("#tblBindData").show();
                },
                error: function (xhr, textStatus, error) {
                    if (typeof console == "object") {
                        console.log(xhr.status + "," + xhr.responseText + "," + textStatus + "," + error);
                    }
                }
            });
        }
    });

}

There are some mistakes in your code,

  1. You have given dataType : json , then there is no need for using jQuery.parseJSON(msg.d).
  2. If you are using "contentType": "application/json; charset=utf-8", , then you should serialize your data before passing it to ajax. Better to remove contentType from yur ajax call.