1er Metodo
var sqlmail=" SELECT DISTINCT email FROM responsables " +
"Inner Join responsablealumno ON responsablealumno.CodigoResponsable = responsables.codigo " +
"Inner Join matriculados ON responsablealumno.CodigoAlumno = matriculados.CodAlumno " +
" Inner Join curso ON curso.Codigo = matriculados.CodCurso " +
" Inner Join nivel ON curso.CodigoNivel = nivel.Codigo " +
"Inner Join division ON curso.CodigoDivision = division.Codigo "+
"Inner Join cursosgrados ON curso.CodigoCursoGrado = cursosgrados.codigo "+
"WHERE email is not null and length( email ) > 0";
2do Metodo
string sqlmail2 = " SELECT DISTINCT email FROM responsables ";
sqlmail2 += " Inner Join responsablealumno ON responsablealumno.CodigoResponsable = responsables.codigo ";
sqlmail2 += "Inner Join matriculados ON responsablealumno.CodigoAlumno = matriculados.CodAlumno ";
sqlmail2 += " Inner Join curso ON curso.Codigo = matriculados.CodCurso ";
sqlmail2 += " Inner Join nivel ON curso.CodigoNivel = nivel.Codigo ";
sqlmail2 += " Inner Join division ON curso.CodigoDivision = division.Codigo ";
sqlmail2 += "Inner Join cursosgrados ON curso.CodigoCursoGrado = cursosgrados.codigo ";
sqlmail2 += "WHERE email is not null and length( email ) > 0";
Luego estan los metodos Concat y StringBuilder , pero eso dejamos para otro dia. Estos 2 metodos demostrados son los mas faciles de implementar.
Saludos
Adalberto Montanía
var sqlmail=" SELECT DISTINCT email FROM responsables " +
"Inner Join responsablealumno ON responsablealumno.CodigoResponsable = responsables.codigo " +
"Inner Join matriculados ON responsablealumno.CodigoAlumno = matriculados.CodAlumno " +
" Inner Join curso ON curso.Codigo = matriculados.CodCurso " +
" Inner Join nivel ON curso.CodigoNivel = nivel.Codigo " +
"Inner Join division ON curso.CodigoDivision = division.Codigo "+
"Inner Join cursosgrados ON curso.CodigoCursoGrado = cursosgrados.codigo "+
"WHERE email is not null and length( email ) > 0";
2do Metodo
string sqlmail2 = " SELECT DISTINCT email FROM responsables ";
sqlmail2 += " Inner Join responsablealumno ON responsablealumno.CodigoResponsable = responsables.codigo ";
sqlmail2 += "Inner Join matriculados ON responsablealumno.CodigoAlumno = matriculados.CodAlumno ";
sqlmail2 += " Inner Join curso ON curso.Codigo = matriculados.CodCurso ";
sqlmail2 += " Inner Join nivel ON curso.CodigoNivel = nivel.Codigo ";
sqlmail2 += " Inner Join division ON curso.CodigoDivision = division.Codigo ";
sqlmail2 += "Inner Join cursosgrados ON curso.CodigoCursoGrado = cursosgrados.codigo ";
sqlmail2 += "WHERE email is not null and length( email ) > 0";
Luego estan los metodos Concat y StringBuilder , pero eso dejamos para otro dia. Estos 2 metodos demostrados son los mas faciles de implementar.
Saludos
Adalberto Montanía
Comentarios
Publicar un comentario