网页起始处理

<script language="vb" runat="server">
Sub page_load(ByVal sender As Object, ByVal e As EventArgs)
Dim Conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Conn.Open()
Dim Da As SqlDataAdapter
Dim Rs As DataSet
Dim Dt As DataTable
Da = New SqlDataAdapter("select * from blog_reg order by blog_id asc", Conn)
Rs = New DataSet()
Da.Fill(Rs, "list1")
Dt = Rs.Tables("list1")

list00.DataSource = Rs.Tables("list1").DefaultView
list00.DataBind()


'指定下拉菜单显示字段
DropDownList1.DataValueField = "blog_user"
'绑定数据源至下拉菜单
DropDownList1.DataSource = Rs.Tables("list1")
DropDownList1.DataBind()

pageall.Text = "共有<font color=red>" & Dt.Rows.Count & "</font>个用户, 分为<font color=red>" & list00.PageCount & "</f页显示"
Rs = Nothing

End Sub

Sub this_change(ByVal sender As Object, ByVal e As DataGridPageChangedEventArgs)
'pageall.text &= ", 现在是第&nbsp;&nbsp;<strong>" & CInt(e.newpageindex) + 1 & "</strong>&nbsp;&nbsp;页!"
list00.CurrentPageIndex = e.NewPageIndex
list00.DataBind()
End Sub

Protected Sub DropDownList1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Conn As New SqlConnection(ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString)
Conn.Open()
Dim Da As SqlDataAdapter
Dim Rs2 As DataSet
Dim Dt As DataTable
Da = New SqlDataAdapter("select * from blog_reg where blog_user='" & DropDownList1.SelectedValue & "'", Conn)
Rs2 = New DataSet()
Da.Fill(Rs2, "list2")
Dt = Rs2.Tables("list2")
GridView1.DataSource = Rs2.Tables("list2").DefaultView
GridView1.DataBind()
blog_user.Text = Dt.Rows(0).Item("blog_user").ToString
blog_nc.Text = Dt.Rows(0).Item("blog_nc").ToString
blog_pwd.Text = Dt.Rows(0).Item("blog_pass").ToString
blog_name.Text = Dt.Rows(0).Item("blog_name").ToString
blog_city.Text = Dt.Rows(0).Item("city1").ToString
regtime.Text = Dt.Rows(0).Item("reg_time").ToString
Rs2 = Nothing
End Sub

</script>

你可能感兴趣的:(Blog,F#,vb)