Hello,
I am creating a program to save repair reports from audio/video equipment.
But i created also a searchbox wich displays 1 or more records.
But how can i get the next record when i press on a button 'next' or 'previous'?
This is some of my code:
[CODE=vbnet]conn = New MySqlConnection
Dim Command As New MySqlCommand
Dim Data As MySqlDataReader
Dim myAdapter As New MySql.Data.MySq lClient.MySqlDa taAdapter
Dim Sql As String
Dim Rows As Integer = 0
conn.Connection String = "server=" & My.Settings.Ser ver & ";" & "user id=" & My.Settings.Log innaam & ";" _
& "password=" & My.Settings.Pas swoord & ";" & "database=" & My.Settings.Dat abase
Sql = "SELECT * FROM device, customer WHERE (Device.custome rID = customer.ID) AND " & Search & " LIKE '%" & SearchText & "%' ORDER BY device.ID;"
conn.Open()
Command.Connect ion = conn
Command.Command Text = Sql
Data = Command.Execute Reader
If Data.HasRows = False Then
MessageBox.Show ("No records found", "Albersoft - RepairService", MessageBoxButto ns.OK, MessageBoxIcon. Information)
Info_Load(sende r, e)
Else
While Data.Read()
'doing thing..
End While
[/CODE]
Somebody some advice?
I mean it's a kind of pagination thing.
Gr Paul
I am creating a program to save repair reports from audio/video equipment.
But i created also a searchbox wich displays 1 or more records.
But how can i get the next record when i press on a button 'next' or 'previous'?
This is some of my code:
[CODE=vbnet]conn = New MySqlConnection
Dim Command As New MySqlCommand
Dim Data As MySqlDataReader
Dim myAdapter As New MySql.Data.MySq lClient.MySqlDa taAdapter
Dim Sql As String
Dim Rows As Integer = 0
conn.Connection String = "server=" & My.Settings.Ser ver & ";" & "user id=" & My.Settings.Log innaam & ";" _
& "password=" & My.Settings.Pas swoord & ";" & "database=" & My.Settings.Dat abase
Sql = "SELECT * FROM device, customer WHERE (Device.custome rID = customer.ID) AND " & Search & " LIKE '%" & SearchText & "%' ORDER BY device.ID;"
conn.Open()
Command.Connect ion = conn
Command.Command Text = Sql
Data = Command.Execute Reader
If Data.HasRows = False Then
MessageBox.Show ("No records found", "Albersoft - RepairService", MessageBoxButto ns.OK, MessageBoxIcon. Information)
Info_Load(sende r, e)
Else
While Data.Read()
'doing thing..
End While
[/CODE]
Somebody some advice?
I mean it's a kind of pagination thing.
Gr Paul
Comment