.NET+SQL SERVER 2000图书管理系统流程图+功能图+ER+全套设计论文 第9页

 

        If myConn.State = ConnectionState.Closed Then

            myConn.Open()

        End If

        Fill(sqlstr)

        myDBGrd.DataSource = ds.Tables(0).DefaultView

        myDBGrd.DataBind()

 

    End Sub

    Public Sub BindDBGrd(ByVal sqlstr As String, ByVal myDBGrd As DataGrid, ByVal SortExp As Object)

        If myConn.State = ConnectionState.Closed Then

            myConn.Open()

        End If

        Fill(sqlstr)

        Dim dv As DataView = ds.Tables(0).DefaultView

        dv.Sort = SortExp

        myDBGrd.DataSource = dv

        myDBGrd.DataBind()

 

    End Sub

    Private Sub BindGrid()

        If Not Session("sqlstr") Is Nothing Then

            Dim sqlstr As String = CType(Session("sqlstr"), String)

 

            BindDBGrd(sqlstr, ResultGrid)

            Session("sqlstr") = sqlstr

        End If

    End Sub

 

 

    Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click

        Dim sign As String = ""

        If AnyChoice.Checked = True Then

            sign = "%"

        End If

        Dim sqlstr As String = "select  * from BookInfo where 1=1 "

 

 

        sqlstr += " and " + dropdownlist1.SelectedValue + " like '" + sign + txtContent.Text.ToString.Trim + sign + "' "

        Session("sqlstr") = sqlstr

        BindGrid()

上一页  [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]  ... 下一页  >> 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有