We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,325 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Listview

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
1
Contributor
0
Replies
1
View
paoi00
Junior Poster in Training
72 posts since Mar 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0526 seconds using 2.66MB