Ho commesso un pò di errori.. ma alla fine ne sono venuto a capo..
ecco il codice.. se a qualcuno magari serve....
codice:
Sub NuovaTabella(ByVal ConnectionString As String, ByVal QueryString As String, _
ByVal NTabella As String, ByVal EnumTabella As Integer)
ReDim Preserve adapter(EnumTabella)
connection.ConnectionString = ConnectionString
connection.Open()
adapter(EnumTabella) = New OleDbDataAdapter(QueryString, connection)
Dim cmdBuilder As New OleDbCommandBuilder(adapter(EnumTabella))
'riempio il dataset e specifico il nome dell tabella titoli
adapter(EnumTabella).FillSchema(Dataset, SchemaType.Source, NTabella)
adapter(EnumTabella).Fill(Dataset, NTabella)
With adapter(EnumTabella)
.InsertCommand = cmdBuilder.GetInsertCommand
.DeleteCommand = cmdBuilder.GetDeleteCommand
.UpdateCommand = cmdBuilder.GetUpdateCommand
End With
ReDim Preserve DataView(EnumTabella)
DataView(EnumTabella) = (New DataView(Dataset.Tables(NTabella)))
connection.Close()
End Sub
Buone feste a tutti!