Torna al Thread

Private Sub Popola_comboSpese() Try Dim strProvider_B As String = "Provider = Microsoft.Jet.OLEDB.4.0;" Dim strOrigine_B As String = "Data Source=" & Application.StartupPath & "\dbCodici.mdb" Dim strConnessione As String = strProvider_B & strOrigine_B Dim Conn As OleDb.OleDbConnection Conn = New OleDb.OleDbConnection(strConnessione) Dim cmdSpese As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter("SELECT * FROM Spese ORDER BY Voce", strConnessione) Dim objTable As New DataTable() cmdSpese.Fill(objTable) Me.cmbSpese.DataSource = objTable Me.cmbSpese.DisplayMember = "Voce" Me.cmbSpese.ValueMember = "ID" Catch ex As Exception MsgBox(ex.Message) End Try End Sub
Copyright © dotNetHell.it 2002-2024
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5