我的第一列很窄,但分页这列撑得很宽
我就想有没有什么方法把分页跨列显示? 截图地址:http://test.hbbaidu.com/t/0.jpg我是VS2005+AccessCS代码:
public partial class _Default : System.Web.UI.Page
{
private DataSet myDS = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
Data_Load();
}
private void Data_Load()
{
string Conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" + Server.MapPath("App_Data/db.mdb");
string Sql = "SELECT id,pic FROM pic ORDER BY id DESC";
OleDbConnection oleConn = new OleDbConnection(Conn);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(Sql, oleConn);
oleConn.Open();
//填充数据库
myDataAdapter.Fill(myDS, "pic");
//绑定记录集
myDataGrid.DataSource = myDS;
myDataGrid.DataBind();
}
protected void myDataGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
myDataGrid.CurrentPageIndex = e.NewPageIndex;
myDataGrid.DataBind();
}
}ASPX代码:
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="myDataGrid" runat="server" AllowPaging="True" OnPageIndexChanged="myDataGrid_PageIndexChanged" PageSize="5"><PagerStyle Mode="NumericPages" PageButtonCount="20" />
</asp:DataGrid>
</div>
</form>
我就想有没有什么方法把分页跨列显示? 截图地址:http://test.hbbaidu.com/t/0.jpg我是VS2005+AccessCS代码:
public partial class _Default : System.Web.UI.Page
{
private DataSet myDS = new DataSet();
protected void Page_Load(object sender, EventArgs e)
{
Data_Load();
}
private void Data_Load()
{
string Conn = "Provider=Microsoft.Jet.OLEDB.4.0; Data source=" + Server.MapPath("App_Data/db.mdb");
string Sql = "SELECT id,pic FROM pic ORDER BY id DESC";
OleDbConnection oleConn = new OleDbConnection(Conn);
OleDbDataAdapter myDataAdapter = new OleDbDataAdapter(Sql, oleConn);
oleConn.Open();
//填充数据库
myDataAdapter.Fill(myDS, "pic");
//绑定记录集
myDataGrid.DataSource = myDS;
myDataGrid.DataBind();
}
protected void myDataGrid_PageIndexChanged(object source, DataGridPageChangedEventArgs e)
{
myDataGrid.CurrentPageIndex = e.NewPageIndex;
myDataGrid.DataBind();
}
}ASPX代码:
<form id="form1" runat="server">
<div>
<asp:DataGrid ID="myDataGrid" runat="server" AllowPaging="True" OnPageIndexChanged="myDataGrid_PageIndexChanged" PageSize="5"><PagerStyle Mode="NumericPages" PageButtonCount="20" />
</asp:DataGrid>
</div>
</form>
解决方案 »
- "/"应用程序中的服务器错误。
- 读取文本后将指定文本显示指定Label上
- 留言本项目,里的【删除留言】,用jquery来实现删除后无刷新更新留言列表
- asp.net 无组件快速上传大文件
- 请问一个Sql语句的写法:
- 新手问大家一个问题:用到TreeView IE Web 的程序在IE里面不能看,倒是在Firefox里面没问题?
- 新人求救关于运行环境的问题(100分)急!
- 问一个关于打开网页的问题
- 当一个网站很多页面要访问同一个数据库时是不是该把数据库地址写入一个叫webconfig的东西?
- 如何给LinkButton指定Target?
- 关于studio.net中调试的配置问题
- 关于对象引用及实例化的问题
http://community.csdn.net/Expert/topic/4644/4644440.xml?temp=.7777216
http://community.csdn.net/Expert/topic/4644/4644440.xml?temp=.7777216
这个问题楼上的哪个帮我解决一下才是正是。呵呵。不过这个问题不是很复杂。只是想听听高手们还有什么别的见解否
性别:女 女 男 女 男 女 男 女
年龄:22 11 22 55 25 44 77 66