hello :) i am working with Search module of a student.. there's a link on the form that when clicked the schedule of the student must be shown on Listview in ScheduleStud Form.... actually i used the showmyrecords() on the other forms but when i used it in this module.. it doesnt works.. please help me..
Imports System
Imports System.Data
Imports System.Data.OleDb
Imports System.Windows.Forms.Form
Public Class ScheduleStud
Private Sub ScheduleStud_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
EnlistmentModule.connect()
showmyrecords()
End Sub
Public Sub showmyrecords()
Dim lvi As ListViewItem
Dim dt As New DataTable
Dim ds As New DataSet
ds.Tables.Add(dt)
Dim da As New OleDbDataAdapter("Select * from Schedulings where YearLevels = '" & search.TextBox1.Text & "' And Sections = '" & search.TextBox12.Text & "' ", asconn)
da.Fill(dt)
Dim acscmd As New OleDb.OleDbCommand
acscmd.CommandText = strsql
acscmd.Connection = asconn
ListView1.Items.Clear()
For Each myrow__1 As DataRow In dt.Rows
lvi = New ListViewItem()
lvi.Text = myrow__1(5)
lvi.SubItems.Add(myrow__1(6))
lvi.SubItems.Add(myrow__1(7))
lvi.SubItems.Add(myrow__1(8) + lvi.SubItems.Add(myrow__1(9))
lvi.SubItems.Add(myrow__1(10))
ListView1.Items.Add(lvi)
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Close()
asconn.Close()
End Sub
End Class