PROBLEMAS CON OBJETO BindingSource para una Aplicacion Master/Detail - DotNetClubs
en

DotNetClubs

Comunidades de estudiantes entusiastas de la tecnología

PROBLEMAS CON OBJETO BindingSource para una Aplicacion Master/Detail

Último artículo 09-12-2007 16:55 escrito por netcigos. 1 respuestas.
Página 1 de 1 (2 elementos)
Ordenar mensajes: Anterior Siguiente
  • 07-12-2007 19:26

    • JEANNIS
    • Contribuyente Top 200
    • Se unió el 07-12-2007
    • Envíos: 1
    • Puntos: 0

    PROBLEMAS CON OBJETO BindingSource para una Aplicacion Master/Detail

    Hola, necesito anexar un dataRelation a un DataSet, para realizar una aplicacion Maestro detalle utilizando dos BindingSource, mi problema se genera al momento de crear la Relacion y añadirla al DataSet, mi codigo es el siguiente:

    DataSet ds1=new DataSet();

    MySqlDataAdapter da1=new MySqlDataAdapter("select * from SUBsecciones",cn);

    da1.Fill(ds1,"SUBsecciones");

    MySqlDataAdapter da2=new MySqlDataAdapter("select * from SECCIONES",cn);

    da2.Fill(ds1,"SECCIONES");

    //RELACION

    DataRelation dr1=new DataRelation ("RELACION",ds1.Tables["SECCIONES" +

    ""].Columns["SEC_ID" +

    ""], ds1.Tables["subsecciones" +

    ""].Columns["SEC_ID"]);

    dr1.Nested=true;

    ds1.Relations.Add (dr1);

    bsMaster.DataSource =ds1;

    bsMaster.DataMember="SUBSECCIONES";

    //GRIDS

    bsMaster.DataSource=ds1;

    bsMaster.DataMember="RELACION";             ///****AQUI SE GENERA EL ERROR LA RELACION// NO       ES   MIEMBRO DE LA TABLA *************////

    /*EL MENSAJE DE ERROR ES EL SIGUIENTE: Se generó la excepción System.ArgumentException en el programa:
    La propiedad DataMember 'RELACION' no se encontró en DataSource.er*/

    Agradezco las soluciones dadas, por favor escribir a mi correo es: jeann3eli@yahoo.es

     

    • Puntos de post: 0
  • 09-12-2007 16:55 en respuesta a

    • netcigos
    • Contribuyente Top 25
    • Se unió el 09-12-2007
    • Envíos: 39
    • Puntos: 205

    Re: PROBLEMAS CON OBJETO BindingSource para una Aplicacion Master/Detail

    Porque escribir tanto codigo cuando podes usar el aistente para generar un dataset tipado que te crea ya las relaciones e incluso podes activar las acutalizaciones en cascadas.
    • Puntos de post: 0
Página 1 de 1 (2 elementos)
(c) DotNetClubs 2008
Ofrecido por Community Server (Commercial Edition)