刚接触ajax,后台生成的数据流怎么输出到前台的TextArea或者指定的一个DIV中呢?求入门代码
.csSqlDataAdapterds=newSqlDataAdapter("selecttop10dwid,dm,xmfromdm_dw_rydm",con);Data...
.cs
SqlDataAdapter ds = new SqlDataAdapter("select top 10 dwid,dm,xm from dm_dw_rydm", con);
DataSet gv = new DataSet();
ds.Fill(gv, "dm_dw_rydm");
Response.Write("<table width=" + 300 + "px><tr><td>单位ID</td><td>人员代码</td><td>名称</td>");
for (int i = 0; i < gv.Tables[0].Rows.Count; i++)
{
Response.Write("<tr>");
Response.Write("<td>" + gv.Tables[0].Rows[i]["dwid"].ToString() + "</td>");
Response.Write("<td>" + gv.Tables[0].Rows[i]["dm"].ToString() + "</td>");
Response.Write("<td>" + gv.Tables[0].Rows[i]["xm"].ToString() + "</td>");
Response.Write("</tr>");
Response.Write("</tr>");
}
Response.Write("</table>"); 展开
SqlDataAdapter ds = new SqlDataAdapter("select top 10 dwid,dm,xm from dm_dw_rydm", con);
DataSet gv = new DataSet();
ds.Fill(gv, "dm_dw_rydm");
Response.Write("<table width=" + 300 + "px><tr><td>单位ID</td><td>人员代码</td><td>名称</td>");
for (int i = 0; i < gv.Tables[0].Rows.Count; i++)
{
Response.Write("<tr>");
Response.Write("<td>" + gv.Tables[0].Rows[i]["dwid"].ToString() + "</td>");
Response.Write("<td>" + gv.Tables[0].Rows[i]["dm"].ToString() + "</td>");
Response.Write("<td>" + gv.Tables[0].Rows[i]["xm"].ToString() + "</td>");
Response.Write("</tr>");
Response.Write("</tr>");
}
Response.Write("</table>"); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询