Torna al Thread

Dim Connessione As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\dbATTI.mdb") Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Connessione.Open() Dim numero_atto As Integer = 15536 If Connessione.State = ConnectionState.Open Then MessageBox.Show(numero_atto) ' mi serve per capire quanto vale la variabile Dim MioCodiceSql As String = "SELECT * FROM preg_atti WHERE numero =" & numero_atto Dim MioCommand As New OleDbCommand(MioCodiceSql, Connessione) Dim reader As OleDbDataReader = MioCommand.ExecuteReader() While reader.Read() MsgBox(reader(0).ToString() & " - Numero: " & reader(1).ToString() & " - Data: " & reader(2).ToString()) End While reader.Close() End If Connessione.Close() End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5