如何从我的数据库sql中读取下一个

时间:2014-07-11 01:51:57

标签: mysql sql vb.net

我有一个图像加载器的应用程序,但我想要的是为下一个和上一个按钮设置一个程序,以便我可以逐个查看它们。

Private Sub Search_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtsearch.Click
    Try
        disconnect()
        connect()

        cmd = New Odbc.OdbcCommand("Select * FROM tblemployee WHERE lname ='" & Trim(TextBox1.Text.TrimEnd()) & "' OR fname ='" & Trim(TextBox1.Text.TrimEnd()) & "'", con)
        dr = cmd.ExecuteReader

        If dr.Read() Then
            Dim bytBLOBData() As Byte = dr("emp_pix")
            Dim stmBLOBData As New MemoryStream(bytBLOBData)
            PictureBox1.Image = Image.FromStream(stmBLOBData)
        Else
            MessageBox.Show("No Information Record, Please Last Name only!")
        End If
    Catch ex As Exception
        Debug.WriteLine("Please try again" & ex.Message)
    End Try
End Sub

如何操作下一个和上一个按钮?

Private Sub Next_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Next.Click
end sub

  'Do Here

 Private Sub Previous_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Previous.Click
end sub

  'Do Here

0 个答案:

没有答案