Buongiorno a tutti,
gentilmente mi fate capire dove e cosa sbaglio nella connessione del Database.accdb? Qui sotto vi posto il codice:
Il messaggio di errore è il seguente:
"Formato della stringa di inizializzazione non conforme alla specifica che inizia all'indice 0"
Ringrazio già in anticipo
Maniblack74
Imports System.Data.Sql
Imports System.Data.SqlClient
Public Class Form3
Dim Cognome, vocaliCognome, consCognome, risCognome As String
Dim Nome, vocaliNome, consNome, risNome As String
Dim CodiceFiscale As String
Dim CodiceComune As String
Dim ListaComuni As New List(Of String)
Dim Anno, Mese, Giorno As String
Private Sub cbo_luogo_nascita_TextChanged(sender As Object, e As EventArgs) Handles cbo_luogo_nascita.TextChanged
Dim Trovato As Boolean = False
Try
Using connessione As New SqlConnection("")
connessione.Open()
Dim Query As String = "SELECT * FROM DB_CITTA Where COMUNE = '" & UCase(cbo_luogo_nascita.Text) & "';"
Using COMANDO As New SqlCommand(Query, connessione)
Using leggi As SqlDataReader = COMANDO.ExecuteReader
While leggi.Read
txt_cap.Text = leggi.GetString(1)
cbo_prov_nascita.Text = leggi.GetString(2)
Trovato = True
End While
If Trovato = False Then
txt_cap.Text = ""
cbo_luogo_nascita.Text = ""
End If
End Using
End Using
End Using
Catch ex As Exception
MsgBox(ex.Message)
End Try
CodiceComune = txt_cap.Text
End Sub