|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Senior Member
Iscritto dal: Aug 2000
Messaggi: 1209
|
[VB.NET] Inserire un DataSet in Tabella
Mi servirebbe una mano per sapere come si fa ad inserire un "DataSet" in una tabella...
Ho questo DataSet: Codice:
Private oConn1 As New OleDbConnection("Provider=MySqlProv;Data Source=My_Database_1;Port=3306;User ID=root;Password=;Location=localhost;") Private oConn2 As New OleDbConnection("Provider=MySqlProv;Data Source=My_Database_2;Port=3306;User ID=root;Password=;Location=localhost;") Dim DS As DataSet = New DataSet() Dim da As New OleDbDataAdapter("SELECT * FROM Anagrafiche", oConn1) da.Fill(DS, "Anagrafiche") come posso fare??? non ho molta pratica con i DataAdapter o DataSet......... se mi potete dare un amano .... |
![]() |
![]() |
![]() |
#2 |
Senior Member
Iscritto dal: Aug 2000
Messaggi: 1209
|
Cosa sto' sbagliando ???
Dim oConn1 As New OleDbConnection("Provider=MySqlProv;Data Source=My_Database_1;Port=3306;User ID=root;Password=;Location=localhost;") Dim oConn2 As New OleDbConnection("Provider=MySqlProv;Data Source=My_Database_2;Port=3306;User ID=root;Password=;Location=localhost;") Codice:
Dim ds As DataSet = New DataSet() Dim da As New OleDbDataAdapter("SELECT * FROM MyTable", oConn1) da.Fill(ds, "MyTable") da.UpdateCommand.Connection = oConn2 'MI DA QUESTO ERRORE ...., al il rigo qui' sopra...... 'Eccezione non gestita di tipo "System.NullReferenceException" in Inserire un DataSet in Tabella.exe 'Informazioni aggiuntive: Riferimento a un oggetto non impostato su un'istanza di oggetto. da.Update(ds, "MyTable") |
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 11:37.