Ciao a tutti,
ho un problema piuttosto assurdo. Non riesco a fare il salvataggio di alcuni campi in un record di una tabella mysql. Questo è il codice:
però mi evidenzia sempre
dicendomi che devo utilizzare new...
Mi spiegate dov'è l'errore?
ho un problema piuttosto assurdo. Non riesco a fare il salvataggio di alcuni campi in un record di una tabella mysql. Questo è il codice:
Codice:
db.apri()
Dim daCustomers As New MySqlDataAdapter()
Dim dsCustomers As New DataSet()
Dim dt As DataTable = dsCustomers.Tables("clienti")
Dim newRow As DataRow = dt.NewRow()
Try
newRow("id") = vbNull
newRow("ragione_sociale") = txtRagioneSociale.Text
newRow("via") = txtIndirizzo.Text
newRow("numero") = "1"
newRow("cap") = txtCAP.Text
newRow("citta") = txtComune.Text
newRow("provincia") = txtProvincia.Text
newRow("cellulare") = txtTelefono.Text
newRow("email") = txtEmail.Text
newRow("partita_iva") = txtPIVA.Text
newRow("codice_fiscale") = txtCF.Text
newRow("pagamento") = "1"
dt.Rows.Add(newRow)
daCustomers.Update(dsCustomers, "clienti")
MsgBox("Record successfully saved.", MsgBoxStyle.Information)
Catch ex As MySqlException
MsgBox(ex.ToString)
End Try
però mi evidenzia sempre
Codice:
Dim newRow As DataRow = dt.NewRow()
dicendomi che devo utilizzare new...
Mi spiegate dov'è l'errore?