DataAdapter con piu tabelle !!!






'create connection and other data objects

Dim nwindConnection As New SqlConnection(connectionString)

Dim nwindAdapter As New SqlDataAdapter("select * from customers; select * from orders; select * from [order details]", nwindConnection)
' questo genera dentro al dataset un array di tre tabelle


Dim nwindDataSet As New DataSet()

'fill the dataset, getting key values

nwindAdapter.MissingSchemaAction = MissingSchemaAction.AddWithKey
nwindAdapter.Fill(nwindDataSet)

'name all of the tables appropriately

' assegna ad ogni Array un nome di tabella (nel dataset)

nwindDataSet.Tables(0).TableName = "Customers"
nwindDataSet.Tables(1).TableName = "Orders"
nwindDataSet.Tables(2).TableName = "OrderDetails"










( dataadapterconpiutabelle.html )- by Paolo Puglisi - Modifica del 17/12/2023