DataGrid1.DataSource=dataset.Tables[0].De.....;第一張表
DataGrid1.DataBind();
或
DataGrid1.DataSource=dataset.Tables[1].De.....;第二張表
DataGrid1.DataBind();
DataGrid1.DataBind();
或
DataGrid1.DataSource=dataset.Tables[1].De.....;第二張表
DataGrid1.DataBind();
解决方案 »
- 如何将存在数据库中的图片(保存的是路径)显示在前台?
- 使用System.Web.Extensions(版本1.0.61025.0), callback无法取返回值,后台代码也跟踪不进去?
- inf文件中如何调用regasm命令?
- vs2005(asp.net)水晶报表绘制柱状图,和饼图
- 请教,如何从只有一条记录的GRIDVIEW中将值取到 SEESION中.最迟5:30给分
- XP HOME安装IIS后无法显示页面
- 有一个问题不明,请各位进来看看
- 高手请进:::关于网页提交的问题,焦点按钮
- 如何在服务器上定义网页显示几秒钟后自动跳转到相关页.在服务器上定义???
- 如何将dropdownlist控件绑定到数据库中的一个字段??
- 抄个最简单的例子都有问题?郁闷ing
- 英文win2000下面,找不要页面的问题
DataGrid绑定数据表:
SqlDa.SelectCommand.Connection = Conn
If Not Page.IsPostBack Then
SqlDa.SelectCommand.CommandText = "SELECT * from WorkFlowInstances where wftemplateid=" + Request("wtid") + " order by createdate desc"
SqlDa.Fill(DSwf1, "WorkFlowInstances")
DataGrid2.DataSource = DSwf1
DataGrid2.DataBind()
End If
DataSet cods=new DataSet();
SqlDataAdapter coda = new SqlDataAdapter(你的SQL语句,connection对象名);
coda.Fill(cods,"自定义表名");DataGrid.DataSource=coda;
DataGrid.DataBind();
以C#为例:
DataSet cods=new DataSet();
SqlDataAdapter coda = new SqlDataAdapter(你的SQL语句,connection对象名);
coda.Fill(cods,"自定义表名");DataGrid.DataSource=cods;//cods,不是coda
DataGrid.DataBind();
本质上是一样的.
你也可以做个视图放两张表的数据,不也是等于一张表嘛.