[求助]统计每个视频的点击率的问题
我做的一个视频的网站,要求统计每个视频的点击率,我在播放视频的那个页面的page_load事件里加了如下代码,大家看看这样做行吗?我试了几次了,dvhits字段始终没有变.各位看一下哪儿有问题啊??
If Not Page.IsPostBack Then
Dim play As String = Request.QueryString("play")
Dim cmd As New SqlCommand("update dvlist set dvhits=dvhits+1 where dvid='" & play & "'", conn)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
hits.EditItemIndex = -1
Call hitss()
end if
数据绑定代码:
Sub hitss()
Dim strsql As String
strsql = "select * from dvlist"
Dim cmd As New SqlCommand(strsql, conn)
Dim adp As New SqlDataAdapter(cmd)
Dim ds As New DataSet
adp.Fill(ds, "dvlist")
hits.DataSource = ds
hits.DataBind()
End Sub