Fazer uma PerguntaFazer uma Pergunta
 

RespondidoFrom datatable to xaml table document

Respostas

  • sexta-feira, 3 de julho de 2009 15:12Kenneth Haugland Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    Hi

    I do not understand what you mean... If you a datatable and want to make a XML tabel use WriteXML()
    If you have a XML table and want it in a datatable use ReadXML()


    well actually i was expecting to get the table directly from the datatable

    Get what? The xml tabel?

    Kenneth

Todas as Respostas

  • sexta-feira, 3 de julho de 2009 9:41Myexp Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    Hi, Do you want to show the datatable data as table on the window? http://msdn.microsoft.com/en-us/library/ms750416.aspx
    You can not expect datatable to generate the code, it can only generate xml code once you call WriteXml method.
    Experience
  • sexta-feira, 3 de julho de 2009 13:38marck68 Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    well actually i was expecting to get the table directly from the datatable
  • sexta-feira, 3 de julho de 2009 15:12Kenneth Haugland Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     Respondido
    Hi

    I do not understand what you mean... If you a datatable and want to make a XML tabel use WriteXML()
    If you have a XML table and want it in a datatable use ReadXML()


    well actually i was expecting to get the table directly from the datatable

    Get what? The xml tabel?

    Kenneth
  • sexta-feira, 3 de julho de 2009 21:14marck68 Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    xaml table
  • sexta-feira, 3 de julho de 2009 23:40Kenneth Haugland Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    dim  ds as new dsystem.data.dataset
    ds.ReadXML(filename)

    and you will have the datatable.... if its from a file
    Kenneth
  • sábado, 4 de julho de 2009 3:38Myexp Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    marck, 

    kenneth's post is what I mean, save your data to xml and read from it with ReadXml or WriteXml. But now I confuse with your requirement of XAML Table
    You want some method to generate xaml code for the DataTable? That is not supported. 

    Experience
  • quinta-feira, 9 de julho de 2009 9:43Jim Zhou - MSFTModeradorMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     

    Hi,

     

    I think Kenneth Haugland has provided a good post in your case. As far as in know, there is no direct approach to make conversion from a ADO.NET DataTable to a Table of type Block in WPF. You need to write your own code to wrap DataTable as a Table using TableColumn  and TableRow.

     If you are still having any issues with this, you can elaborate on you scenario. Some sample code will be much better for others to understand you.

     

    Thanks.

  • quinta-feira, 9 de julho de 2009 9:48Kenneth Haugland Medalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuárioMedalhas de usuário
     
    If you do have a XAML table and want to read it... I suggest you convert it to a txt file and read line by line.... It will be a tremendus task... If you can store and read it as a XML table you will save a lot of trouble....


    Kenneth