views:

138

answers:

1

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)
+2  A: 

Of course ADO.NET supports joins!

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

Dan Diplo
i looked but there aren't any examples with joins
kjack
Joins in the select statement, I mean
kjack
But have you tried adding one? It will work, believe me.
Dan Diplo
Dan, I'm an idiot. I got 'join not supported messages' and it was because of errors in my select syntax while I assumed that it meant joins not possible
kjack
Hey, no worries, we've all done similar things, believe me :)
Dan Diplo