Torna al Thread

Dim sql As String = "SELECT COMUNE, CAP, [PREFISSO TEL] FROM dbCOMUNI" Dim thisCommand As New SqlClient.SqlCommand(sql, thisConnection) Try thisConnection.Open() Dim thisReader As SqlClient.SqlDataReader = thisCommand.ExecuteReader() While (thisReader.Read()) ComboBox1.Items.Add(thisReader.Item(0) & " | " & thisReader.Item(1) & " | " & thisReader.Item(2)) End While Catch ex As SqlClient.SqlException MsgBox("Error: " & ex.ToString()) Finally thisConnection.Close() End Try
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5