ragazzi...![]()
ho praticamente un file di record aperto.....e devo aprirne il contenuto e visualizzarlo in uan datagridview ......coem posso fare....vi copio il codice:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
lunghezzarec = Len(alunno)
FileOpen(1, "E:\david.d&g", OpenMode.Random, , , lunghezzarec)
alunno.cognome = TextBox1.Text
alunno.nome = TextBox2.Text
alunno.classe = TextBox3.Text
End Sub
Private Sub aggrecord_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles aggrecord.Click
FilePut(1, alunno, ultimorec + 1)
End Sub
Private Sub apri_record_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles apri_record.Click
Do While Not EOF(1)
FileGet(1, alunno, 1)
Dim n As String = DataGridView1.Rows.Add
DataGridView1.Rows(n).Cells(0).Value = alunno.cognome
DataGridView1.Rows(n).Cells(1).Value = alunno.nome
DataGridView1.Rows(n).Cells(2).Value = alunno.classe
Loop
End Sub