Jquery DataTables警告:为第0行请求了未知参数“0”
我正在使用vb.net。我使用一个动态数据表,它可以搜索、列出、更新和删除数据。但是我的datatable没有任何问题。但只有一个问题。当我刷新包含Datatables的页面时,我得到一个如下的弹出错误Jquery DataTables警告:为第0行请求了未知参数“0”,jquery,vb.net,datatables,Jquery,Vb.net,Datatables,我正在使用vb.net。我使用一个动态数据表,它可以搜索、列出、更新和删除数据。但是我的datatable没有任何问题。但只有一个问题。当我刷新包含Datatables的页面时,我得到一个如下的弹出错误 <form style =" margin-top : 220px;" id="form2" runat="server"> <table id="liste" class="display" cellspacing="0" width="100%">
<form style =" margin-top : 220px;" id="form2" runat="server">
<table id="liste" class="display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Sil</th>
<th>Düzenle</th>
<th>Proje Referans Numarası</th>
<th>Proje Adı</th>
<th>Proje Detay</th>
<th>Kullanacak Olan Departman</th>
<th>Başlangıç tarihi</th>
<th>Başlangıç Saati</th>
<th>Bitiş Tarihi</th>
<th>Bitiş Saati</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Sil</th>
<th>Düzenle</th>
<th>Proje Referans Numarası</th>
<th>Proje Adı</th>
<th>Proje Detay</th>
<th>Kullanacak Olan Departman</th>
<th>Başlangıç tarihi</th>
<th>Başlangıç Saati</th>
<th>Bitiş Tarihi</th>
<th>Bitiş Saati</th>
</tr>
</tfoot>
<tbody>
<tr>
<%Dim strBaglanti As String = "Data Source=127.0.0.1;Initial Catalog=YOTK_TEST;Persist Security Info=True;User ID=username;Password=password"
Dim sayac = 0
Dim CN As New System.Data.SqlClient.SqlConnection(strBaglanti)
Dim strQ As String = "SELECT * FROM Proje"
Dim CMD As New System.Data.SqlClient.SqlCommand(strQ, CN)
CN.Open()
Dim Reader As System.Data.SqlClient.SqlDataReader = CMD.ExecuteReader()
Do While Reader.Read
Response.Write("<tr><td><center><a href='delete_project.aspx?id=" + Reader("ID").ToString() + "'><img width = '52px' height = '52px' src='css/images/delete.png'/></a></center></td><td><center><a href='edit_project.aspx?id=" + Reader("ID").ToString() + "'><img width = '52px' height = '52px' src='css/images/edit.png'/></a></center></td><td><center>" + Reader("ID").ToString + "</center></td><td><center>" + Reader("ProjeAdi").ToString + "</center></td><td><center><textarea style='width : 300px; height:100px;'>" + Reader("ProjeAciklama").ToString + "</textarea></center></td><td><center>" + Reader("Departman").ToString + "</center></td><td><center>" + Reader("BaslangicTarihi").ToString + "</center></td><td><center>" + Reader("BaslangicSaati").ToString + "</center></td><td><center>" + Reader("BitisTarihi").ToString + "</center></td><td><center>" + Reader("BitisSaati").ToString + "</center></td></tr>")
Loop
CN.Close()
%>
</tr>
</tbody>
</table>
</form>
Sil
杜泽勒
努马拉斯项目
阿德ı项目
Proje Detay
库拉纳卡奥兰部门
巴朗塔里希
巴朗萨蒂
比蒂塔里希
比蒂萨蒂
Sil
杜泽勒
努马拉斯项目
阿德ı项目
Proje Detay
库拉纳卡奥兰部门
巴朗塔里希
巴朗萨蒂
比蒂塔里希
比蒂萨蒂
这是我的表代码
<script src="http://cdn.datatables.net/plug-ins/1.10.7/integration/jqueryui/dataTables.jqueryui.js"></script>
<script>
$(document).ready(function() {
$('#liste').dataTable();
} );
</script>
$(文档).ready(函数(){
$('#liste').dataTable();
} );
这是我的JavaScript代码。问题是什么?根据,可能出现问题的原因之一是:
- 表格中的单元格数量不满足方程式
(即页眉中定义的列多于表体中定义的列,反之亦然)#cells=#columns*#rows
。下面是一个经过更正的代码,为了简洁起见,省略了其他部分
<tbody>
<%Dim strBaglanti As String = "Data Source=127.0.0.1;Initial Catalog=YOTK_TEST;Persist Security Info=True;User ID=username;Password=password"
Dim sayac = 0
Dim CN As New System.Data.SqlClient.SqlConnection(strBaglanti)
Dim strQ As String = "SELECT * FROM Proje"
Dim CMD As New System.Data.SqlClient.SqlCommand(strQ, CN)
CN.Open()
Dim Reader As System.Data.SqlClient.SqlDataReader = CMD.ExecuteReader()
Do While Reader.Read
Response.Write("<tr><td><center><a href='delete_project.aspx?id=" + Reader("ID").ToString() + "'><img width = '52px' height = '52px' src='css/images/delete.png'/></a></center></td><td><center><a href='edit_project.aspx?id=" + Reader("ID").ToString() + "'><img width = '52px' height = '52px' src='css/images/edit.png'/></a></center></td><td><center>" + Reader("ID").ToString + "</center></td><td><center>" + Reader("ProjeAdi").ToString + "</center></td><td><center><textarea style='width : 300px; height:100px;'>" + Reader("ProjeAciklama").ToString + "</textarea></center></td><td><center>" + Reader("Departman").ToString + "</center></td><td><center>" + Reader("BaslangicTarihi").ToString + "</center></td><td><center>" + Reader("BaslangicSaati").ToString + "</center></td><td><center>" + Reader("BitisTarihi").ToString + "</center></td><td><center>" + Reader("BitisSaati").ToString + "</center></td></tr>")
Loop
CN.Close()
%>
</tbody>
看看这里: