views:

13

answers:

0

I have the following code which return a dataset in cuestionarios.obtenerCuestionarios

    Dim cuestionarios As New ObtenerCuestionarios
    Dim ds As New DataSet("Cuestionarios")
    ds = cuestionarios.obtenerCuestionarios
    DataGridView1.DataSource = ds.DefaultViewManager
    DataGridView1.DataMember = "cuestionario"

Which creates a error "Child list for field cuestionario cannot be created."

Now I can doit this way

    Dim cuestionarios As New ObtenerCuestionarios
    xmlData.DataSet.ReadXml("..\Debug\data.xml")
    Dim ds As New DataSet("Cuestionarios")
    ds = xmlData.DataSet
    DataGridView1.DataSource = ds.DefaultViewManager
    DataGridView1.DataMember = "cuestionario"

Where xmlData is XmlDataDocument (which is getting deprecated) my 2 questions are basically

Which is the correct way for if reading from a file and why is failing when directly trying to pass it a dataset?