Question

AFAIK ado.net datareaders and datasets don't seem to support joins in sql statements.

Is it possible to retrieve the ado.net equivalent of this ado recordset using just the information presented in this ado/vb code : I am asking the question this way as I am trying to largely automate the conversion of ado to ado.net

    Dim myconn As New ADODB.Connection    
myconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.3.51;Data Source=c:\TestDB1.mdb;Jet OLEDB:System Database=c:\TestDB1.mdw;User ID=TestDB;Password=123456;"    
myconn.Open()    
Dim myrec As New ADODB.Recordset    
Dim str1 As String = "select TableA.field0, tableB.field0 from TableA inner join TableB on TableA.field1 = TableB.field1 where tableA.field3 > 0 order by tableA.field4" 
 myrec.Open(str1, myconn)
Was it helpful?

Solution

Of course ADO.NET supports joins!

See ADO.NET: Retrieve Data using OLE DB quickstart tutorial.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top