views:

33

answers:

2

I have a problem. I want to create sql question

select * from Firma left outer join FirmaAdres on FirmaAdres.Typ = 1 and FirmaAdres.FirmaID = Firma.ID

in subsonic

I have written

SelectColumns("Firma.*").From().LeftOuterJoin(FirmaTable.IDColumn, FirmaAdresTable.FirmaIDColumn).And(FirmaAdresTable.AdresTypIDColumn).IsEqualTo(1)

When I checked what sql question is created I noticed then left outer join is changed to Inner join!!!

Could anyone help me??

A: 

Subsonic doesn't support LeftOuterJoin. You need to emulate the left join in LINQ (see http://www.devsource.com/c/a/Languages/Defining-a-Left-Join-with-LINQ-Queries/ for more details) In my opinion the effort don't deserves the pain that is wating for you. I suggest you to use a simple, boring and traditional stored procedure here.

Apocatastasis
A: 

hola, yo pude solucionar el error bajando el binario y corrigiendo lo siguiente: objeto modificado:namespace SubSonic.Query, clase SqlQuery, metodo CreateJoin(string fromColumnName, string toColumnName, Join.JoinType type)

Problema encontrado: en la clase SubSonic.Query.SqlQuery en el metodo CreateJoin(string fromColumnName, string toColumnName, Join.JoinType type) recibe el tipo de join pero luego dentro de la funcion le pasa fijo asi: //CreateJoin(fromColumn, toColumn, Join.JoinType.Inner);

solucion: bajar el binario de subsonic y corregirlo asi: CreateJoin(fromColumn, toColumn, type)

con esto ahora te va aarmar bienla consulta saludos