joao20 Posted May 28, 2012 at 02:06 AM Report #458451 Posted May 28, 2012 at 02:06 AM Preciso de ajuda num código que cria um ficheiro xml com os dados que tenho inserido na base dados experimentei o seguinte código mas no ficheiro xml so aparece os dados de 1 empregado e precisava que aparecesse todos os empregados adicionados agradeço se alguém me puder ajudar XmlTextWriter xWriter = new XmlTextWriter("Empregados.xml", Encoding.UTF8); xWriter.WriteStartElement("Empregados"); xWriter.WriteStartElement("Empregados"); xWriter.WriteStartElement("nome"); xWriter.WriteString(txtNome.Text); xWriter.WriteStartElement("Cargo"); xWriter.WriteString(txtCargo.Text); xWriter.WriteStartElement("Telefone"); xWriter.WriteString(comboBox1.Text); xWriter.WriteStartElement("Observaocao"); xWriter.WriteString(txtObservacao.Text); xWriter.WriteEndElement(); xWriter.WriteEndElement(); xWriter.WriteEndElement(); xWriter.Close();
bruno1234 Posted May 28, 2012 at 06:47 PM Report #458631 Posted May 28, 2012 at 06:47 PM Tens que por isso dentro de um ciclo. Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos
joao20 Posted May 29, 2012 at 11:36 AM Author Report #458849 Posted May 29, 2012 at 11:36 AM Tens que por isso dentro de um ciclo. podes mostrar 1 exemplo ? tenho algumas dificuldades e preciso acabar o trabalho
bruno1234 Posted May 29, 2012 at 09:48 PM Report #459020 Posted May 29, 2012 at 09:48 PM Pesquisa na net como fazer um for ou um foreach. Matraquilhos para Android. Gratuito na Play Store. https://play.google.com/store/apps/details?id=pt.bca.matraquilhos
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now