Riempire una treeview da un dataset
Dim DSNWind As DataSet
Dim CNnwind As New SqlClient.SqlConnection("DATA SOURCE=servername;USER ID=;PASSWORD=;INITIAL CATALOG=northwind;") '<==== CHANGE HERE
Dim DACustomers As New SqlClient.SqlDataAdapter("SELECT CustomerID, CompanyName, ContactName, Country FROM customers WHERE country = 'Germany'", CNnwind)
Dim DAOrders As New SqlClient.SqlDataAdapter("SELECT CustomerID, OrderID, OrderDate, ShippedDate, ShipVia, Freight FROM orders where customerid in (select customerid from customers where country = 'Germany')", CNnwind)
Dim DAOrderDetails As New SqlClient.SqlDataAdapter("Select * from [Order Details] where OrderID in (SELECT OrderID FROM orders where customerid in (select customerid from customers where country = 'Germany'))", CNnwind)
DSNWind = New DataSet()
CNnwind.Open()
DACustomers.Fill(DSNWind, "dtCustomers")
DAOrders.Fill(DSNWind, "dtOrders")
...
Leggi il seguito »
Dim CNnwind As New SqlClient.SqlConnection("DATA SOURCE=servername;USER ID=;PASSWORD=;INITIAL CATALOG=northwind;") '<==== CHANGE HERE
Dim DACustomers As New SqlClient.SqlDataAdapter("SELECT CustomerID, CompanyName, ContactName, Country FROM customers WHERE country = 'Germany'", CNnwind)
Dim DAOrders As New SqlClient.SqlDataAdapter("SELECT CustomerID, OrderID, OrderDate, ShippedDate, ShipVia, Freight FROM orders where customerid in (select customerid from customers where country = 'Germany')", CNnwind)
Dim DAOrderDetails As New SqlClient.SqlDataAdapter("Select * from [Order Details] where OrderID in (SELECT OrderID FROM orders where customerid in (select customerid from customers where country = 'Germany'))", CNnwind)
DSNWind = New DataSet()
CNnwind.Open()
DACustomers.Fill(DSNWind, "dtCustomers")
DAOrders.Fill(DSNWind, "dtOrders")
...
Leggi il seguito »
Invia questo articolo via email
LEGGI LE ALTRE NOTIZIE DE "IL BLOGGATORE"










