Torna al Thread

... apri la connessione al DB dim rowIndex as integer = 0 Dim Command As New SqlCommand("Select * from tabella where bla bla bla", Conn) Dim myreader As SqlDataReader = Command.ExecuteReader() While myreader.Read() 'Questo legge tutti i dati estratti dal primo record fino all'ultimo rowIndex = DataGridView1.Rows.Count DataGridView1.Rows.Insert(rowIndex, 1) 'aggiunge la riga alla griglia in cui scrive i dati del record corrente DataGridView1.Rows(rowIndex).Cells("ID").Value = myreader("ID") DataGridView1.Rows(rowIndex).Cells("codice").Value = myreader("codiceArticolo") End While myreader.Close() chiudi laconnessione al db
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5