English versionEnglish
杨涛的个人主页

留言簿

搜索留言
关键字: 
签写留言
姓名:*
主页:
留言内容(2000字以内):*

验证码:
注意:留言内容不支持UBB及HTML标签
为防止发布垃圾或有害留言,所有发布的留言需站长批准后才会显示。

首页  上一页  ...  344  345  346  347  348  349  350  351  352  353  ...  下一页  尾页
2005/6/10 16:47:00  那一刀的风流
您好,我得问题已经解决,是一开始测试时的代码很乱,留下了一些干扰的代码,删除后可以正常使用了,谢谢您的辛苦工作给我们带来方便
回复:不用客气,谢谢使用AspNetPager!
2005/6/10 16:34:00  那一刀的风流
看到上次留言显示混乱
您到这里看看吧
http://www.51js.com/viewthread.php?tid=39195&pid=351677&page=1&sid=H06744#pid351677
2005/6/10 16:16:00  那一刀的风流
我想用作datalist的分页,但是不显示控件,数据库表里面有超过60行的数据
您看代码哪里错了
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
         If Not IsPostBack Then
               Call mydatabind()
        End If
    End Sub

    Private Sub AspNetPager1_PageChanged(ByVal src As System.Object, ByVal e As Wuqi.Webdiyer.PageChangedEventArgs) Handles AspNetPager1.PageChanged
        AspNetPager1.CurrentPageIndex = e.NewPageIndex
        Call mydatabind()
    End Sub
    Sub mydatabind()
        Dim strconn, sql As String
        Dim objconn As SqlConnection
        Dim objcmd As SqlCommand
        Dim objcmd1 As SqlDataAdapter
        Dim objreader As SqlDataReader
        Dim ds As DataSet = New DataSet
        strconn = ConfigurationSettings.AppSettings("strconn")
        objconn = New SqlConnection
        objconn.ConnectionString = strconn
        objconn.Open()
        objcmd = New SqlCommand
        objcmd.Connection = objconn
 
            objcmd.CommandText = "select count(id) from subject where forum='" & Request.QueryString("forum") & "' and sort1='" & Request.QueryString("sort1") & "'"

        Dim totalcount As Integer
        totalcount = objcmd.ExecuteScalar
        AspNetPager1.RecordCount = totalcount
        AspNetPager1.PageSize = 30

            objcmd.CommandText = "select id,title,start_time,teacher,city,price,hit from subject where forum='" & Request.QueryString("forum") & "' and sort1='" & Request.QueryString("sort1") & "'"

        objcmd1 = New SqlDataAdapter(objcmd)
        objcmd1.Fill(ds, AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, "subject")
        AspNetPager1.RecordCount = ds.Tables("subject").DefaultView.Count
        AspNetPager1.CustomInfoText = "记录总数:" & AspNetPager1
2005/6/10 16:04:00  Lee
楼下的Lee,那个表的问题,我弄好了。谢谢!
回复:好!这两天回家探亲没有上班,没有及时回复请原谅。
2005/6/9 18:58:00  闪
斑竹:帮忙看看这个存储过程是哪里错了?怎么有重复的数据,谢谢
CREATE procedure Select_Product_ByCategory
(@pagesize int,
@pageindex int,
@docount bit)
as
set nocount on
if(@docount=1)
select count(Products.ProductId) from Products INNER JOIN
      ProductSKUs ON Products.ProductId = ProductSKUs.ProductId
else
begin
declare @indextable table(id int identity(1,1),nid int)
declare @PageLowerBound int
declare @PageUpperBound int
set @PageLowerBound=(@pageindex-1)*@pagesize
set @PageUpperBound=@PageLowerBound+@pagesize
set rowcount @PageUpperBound
insert into @indextable(nid) select products.ProductId from Products INNER JOIN
      ProductSKUs ON Products.ProductId = ProductSKUs.ProductId order by Products.ProductId desc
SELECT Products.ProductId, Products.Name, Products.ShortDescription, Products.Deleted, 
      ProductSKUs.SKU, ProductSKUs.RetaiPrice, ProductSKUs.ActralPrice
FROM Products INNER JOIN
      ProductSKUs ON Products.ProductId = ProductSKUs.ProductId , @indextable t where Products.ProductId=t.nid
and t.id>@PageLowerBound and t.id<=@PageUpperBound order by t.id
end
set nocount off
GO
回复:什么样的重复数据?Product表中的ProductID是标识列吗?
2005/6/9 14:10:00  Lee
ck ye js是三个字段
2005/6/9 14:08:00  Lee
我有一个表(tcb),里面有两条记录。是想把tcb表中对应的字段值相减应。把每个字段的差值显示在label.该怎么做呢。
比如:表tcb中有两条记录  
    ck             ye         js  
1. 3699.20      264.87      678.00    
2. 3500.00      250.44      800.50 
 
将3699.20-3500.00  的差值显示在label1  
将264.87-2500.44  的差值显示在label2  
将678.00-800.50的差值显示在label3  
怎样读取第一条记录指定字段的值减去第二条记录指定字段的值?  
在线等待。 
 能否给我点具体的代码吧
回复:您可以把这两条记录选出来填充到一个DataTable中,然后用前一个DataRow中指定字段的值减去后一个DataRow相应字段的值即可,不过我没到您是通过什么条件来确定哪一条记录该被另一条记录减去?谢谢!
2005/6/8 16:27:00  溜达
但查询时我没用DatePicker控件。     下面该行显示红色:
adapter1.Fill(ds,pager.PageSize*(pager.CurrentPageIndex-1),pager.PageSize,"news");
回复:您好,从这段代码上看不出有什么问题,您能编译通过吗?谢谢!
2005/6/8 16:16:00  溜达
我在用你的控件,翻页速度也蛮快的 。有一个查询页面记录数3000多条吧,可是我翻到11页13页23页54页就是某几个页,会出错,错误信息:Unspecified System Error = -21001. 但是其他页面都好的。和我在查询中用的DatePicker日历控件有关吗?(其他页面没有用DatePicker日历控件)。
Unspecified System Error = -21001是什么错误码?
回复:您好,从这样的错误信息中无法看出什么错误,您可以在调试模式下运行看看有没有更详细的错误信息。谢谢!
2005/6/8 15:09:00  油岩
我想在datagrid上,鼠标点击一行,产生一种颜色。
public void  dg_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType==ListItemType.Item)
{
 e.Item.Attributes.Add(这里该怎么写?);
}
}
谢谢!
回复:e.Item.Attributes.Add("onclick","this.style.backgroundColor=\'#969696\';");其中的#969696可以改为任何你想要的十六进制背景颜色值。谢谢!
首页  上一页  ...  344  345  346  347  348  349  350  351  352  353  ...  下一页  尾页