dv.Sort = SortExp
myDBGrd.DataSource = dv
myDBGrd.DataBind()
End Sub
Private Sub BindDBGrid()
Dim sqlstr As String = "select * from BookInfo,LendInfo where BookInfo.BookID=LendInfo.BookID and IsBack=0 and UserID='" + txtUserID.Text.ToString + "'"
BindDBGrd(sqlstr, ListDGrid)
End Sub
Public Function ExecReaderSql(ByVal sqlstr As String) As SqlDataReader
If myConn.State = ConnectionState.Closed Then
myConn.Open()
End If
myCmd = New SqlCommand(sqlstr, myConn)
Dim reader As SqlDataReader
reader = myCmd.ExecuteReader
myCmd.Dispose()
Return reader
End Function
Private Function GetBookID() As String
Dim sqlstr As String = "select BookID from BookInfo where BarCode='" + txtBookID.Text.ToString.Trim + "'"
Dim BookID As String = ""
Dim myreader As SqlDataReader = ExecReaderSql(sqlstr)
If myreader.Read Then
BookID = myreader("BookID")
End If
myConn.Close()
Return BookID
End Function
Public Function GetCurNum(ByVal UserID As String) As Integer
Dim sqlstr As String = "select count(*) as Num from LendInfo where UserID='" + UserID + "' and IsBack=0 "
Dim myreader As SqlDataReader = ExecReaderSql(sqlstr)
Dim num As Integer = 0
If myreader.Read Then
num = myreader("Num")
End If
myConn.Close()
Return num
<< 上一页 [21] [22] [23] [24] [25] 下一页