最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

js DataSet數(shù)據(jù)源處理代碼

 更新時(shí)間:2010年03月29日 14:46:45   作者:  
js DataSet數(shù)據(jù)源處理代碼,需要的朋友可以參考下。
[Ajax.AjaxMethod()]
public DataSet GetDataSet()
{
OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:工作項(xiàng)目分析 estdb.mdb;Persist Security Info=True;");
DataSet ds = new DataSet();
try
{
OleDbCommand cmd = conn.CreateCommand();
cmd.CommandText = "select * from t_name";
cmd.CommandType = CommandType.Text;
OleDbDataAdapter da = new OleDbDataAdapter(cmd);
da.Fill(ds);
return ds;
}
catch
{
conn.Close();
throw;
}
}
[/code]
復(fù)制代碼 代碼如下:

<script language="JavaScript">
// var ds =test.GetDataTable().value; //table數(shù)據(jù)源
//alert(ds.Rows[i].level2;
function getDataSet()
{
var ds =test.GetDataSet().value;
if(ds != null && typeof(ds) == "object" && ds.Tables != null)
{
var s = new Array();
s[s.length] = "<table style='border: #000000 1px solid; color: #993333; font-family: 'Microsoft Sans Serif'; background-color: #ffff99;'>";
for(var i=0; i<ds.Tables[0].Rows.length; i++)
{
s[s.length] = "<tr>";
s[s.length] = "<td>" + ds.Tables[0].Rows[i].id + "</td>";
s[s.length] = "<td>" + ds.Tables[0].Rows[i].f_date + "</td>";
s[s.length] = "<td>" + ds.Tables[0].Rows[i].f_name + "</td>";
s[s.length] = "</tr>";
}
s[s.length] = "</table>";
document.getElementById("div1").innerHTML = s.join("");
}
else
{
alert("調(diào)用Ajax接口函數(shù)錯(cuò)誤!");
}
}
</script>

相關(guān)文章

最新評(píng)論

资中县| 宁夏| 宜君县| 翁牛特旗| 鲁山县| 宝坻区| 浮梁县| 曲麻莱县| 平定县| 安阳县| 潜江市| 凤庆县| 宁蒗| 孟村| 新巴尔虎左旗| 吴忠市| 凭祥市| 乐昌市| 仙桃市| 丰镇市| 大宁县| 灵石县| 手游| 铁岭县| 库伦旗| 石泉县| 宣威市| 尉氏县| 仪征市| 长岭县| 图木舒克市| 运城市| 黄石市| 文成县| 五家渠市| 蒙山县| 苍溪县| 望江县| 高雄市| 上饶县| 迁西县|