Click here to Skip to main content
14,335,105 members

Visual Basic

 
GeneralRe: Using a usb barcode reader Pin
Dave Kreskowiak21-Oct-16 7:18
mveDave Kreskowiak21-Oct-16 7:18 
GeneralRe: Using a usb barcode reader Pin
desanti21-Oct-16 7:23
memberdesanti21-Oct-16 7:23 
GeneralRe: Using a usb barcode reader Pin
Dave Kreskowiak21-Oct-16 7:24
mveDave Kreskowiak21-Oct-16 7:24 
GeneralRe: Using a usb barcode reader Pin
desanti21-Oct-16 7:35
memberdesanti21-Oct-16 7:35 
GeneralRe: Using a usb barcode reader Pin
Dave Kreskowiak21-Oct-16 7:56
mveDave Kreskowiak21-Oct-16 7:56 
GeneralRe: Using a usb barcode reader Pin
desanti21-Oct-16 8:14
memberdesanti21-Oct-16 8:14 
GeneralRe: Using a usb barcode reader Pin
Dave Kreskowiak21-Oct-16 9:18
mveDave Kreskowiak21-Oct-16 9:18 
QuestionHow to generate XML file with serialisation in vb.net Pin
Member 1280320219-Oct-16 7:51
memberMember 1280320219-Oct-16 7:51 
Hi there,

I have a one big prob.

I want to generate xml file with a specific format Like this syntax!:


<declarationrelevededuction xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<identifiantfiscal>1088081
<annee>2016
<periode>8
<regime>1
<relevedeductions>
<rd>
<ord>1
<num>FF160400146
<des>PRESTATION
<mht>2400.00
<tva>480.00
<ttc>2880.00
<reff>
<if>52803595
<nom>LEADER SOFT
<ice>001540114000046

<tx>20.00
<mp>
<id>2

<dpai>2016-08-01
<dfac>2016-01-30

<rd>
<ord>2
<num>FF160400147
<des>PRESTATION
<mht>1500.00
<tva>300.00
<ttc>1800.00
<reff>
<if>52803595
<nom>LEADER SOFT
<ice>001540114000046

<tx>20.00
<mp>

So, I've created form with button to generate the xml files and I created this code for That:

Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim xmlsetting As New XmlWriterSettings
Dim writxml As XmlWriter = XmlWriter.Create("mytest.xml", xmlsetting)
Try
With writxml
.WriteStartDocument()
.WriteStartElement("DeclarationReleveDeduction")
.WriteStartElement("identifiantFiscal")
.WriteString("111111")
.WriteEndElement()
.WriteStartElement("annee")
.WriteString("2016")
.WriteEndElement()
.WriteStartElement("periode")
.WriteString("8")
.WriteEndElement()
.WriteStartElement("regime")
.WriteString("1")
.WriteEndElement()
.WriteStartElement("Relvededution")
For i As Integer = 1 To 10
.WriteStartElement("Id")
.WriteString(i)
.WriteStartElement("Nom")
.WriteString("Nom " & i)
.WriteEndElement()
.WriteStartElement("prenom")
.WriteString("Prenom " & i)
.WriteEndElement()
.WriteStartElement("Adresse")
.WriteString("Adresse " & i)
.WriteEndElement()
.WriteEndElement()
Next
.WriteEndElement()
.WriteEndElement()
.WriteEndDocument()
.Close()
End With
MsgBox("fichier a été généré avec succès", vbInformation)
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub

when I generated the xml file I have got like this format:

<declarationrelevededuction><identifiantfiscal>111111<annee>2016<periode>8<regime>1<relvededution><id>1<nom>Nom 1<prenom>Prenom 1<adresse>Adresse 1<id>2<nom>Nom 2<prenom>Prenom 2<adresse>Adresse 2<id>3<nom>Nom 3<prenom>Prenom 3<adresse>Adresse 3<id>4<nom>Nom 4<prenom>Prenom 4<adresse>Adresse 4<id>5<nom>Nom 5<prenom>Prenom 5<adresse>Adresse 5<id>6<nom>Nom 6<prenom>Prenom 6<adresse>Adresse 6<id>7<nom>Nom 7<prenom>Prenom 7<adresse>Adresse 7<id>8<nom>Nom 8<prenom>Prenom 8<adresse>Adresse 8<id>9<nom>Nom 9<prenom>Prenom 9<adresse>Adresse 9<id>10<nom>Nom 10<prenom>Prenom 10<adresse>Adresse 10



Please help me I need to do that in this days of current month Cry | :(( Confused | :confused:
AnswerRe: How to generate XML file with serialisation in vb.net Pin
jkirkerx19-Oct-16 9:13
professionaljkirkerx19-Oct-16 9:13 
Questionprogram application to connect HSAjet Mini Key ink jet printer Pin
Member 1119728817-Oct-16 15:07
memberMember 1119728817-Oct-16 15:07 
AnswerRe: program application to connect HSAjet Mini Key ink jet printer Pin
Richard MacCutchan18-Oct-16 5:05
protectorRichard MacCutchan18-Oct-16 5:05 
GeneralRe: program application to connect HSAjet Mini Key ink jet printer Pin
Member 1119728818-Oct-16 21:43
memberMember 1119728818-Oct-16 21:43 
GeneralRe: program application to connect HSAjet Mini Key ink jet printer Pin
Richard MacCutchan18-Oct-16 23:38
protectorRichard MacCutchan18-Oct-16 23:38 
QuestionA way to get Next node or previous node in a treeview according to its position on the tree Pin
desanti14-Oct-16 13:30
memberdesanti14-Oct-16 13:30 
AnswerRe: A way to get Next node or previous node in a treeview according to its position on the tree Pin
Richard MacCutchan14-Oct-16 21:10
protectorRichard MacCutchan14-Oct-16 21:10 
GeneralRe: A way to get Next node or previous node in a treeview according to its position on the tree Pin
desanti15-Oct-16 16:49
memberdesanti15-Oct-16 16:49 
GeneralRe: A way to get Next node or previous node in a treeview according to its position on the tree Pin
Richard MacCutchan15-Oct-16 21:33
protectorRichard MacCutchan15-Oct-16 21:33 
AnswerRe: A way to get Next node or previous node in a treeview according to its position on the tree Pin
Eddy Vluggen15-Oct-16 0:31
mveEddy Vluggen15-Oct-16 0:31 
AnswerRe: A way to get Next node or previous node in a treeview according to its position on the tree Pin
Richard Deeming17-Oct-16 1:49
mveRichard Deeming17-Oct-16 1:49 
QuestionAccess and post data via Web Service using VB6 Pin
Member 127792476-Oct-16 0:34
memberMember 127792476-Oct-16 0:34 
AnswerRe: Access and post data via Web Service using VB6 Pin
Richard MacCutchan6-Oct-16 0:50
protectorRichard MacCutchan6-Oct-16 0:50 
AnswerRe: Access and post data via Web Service using VB6 Pin
Dave Kreskowiak6-Oct-16 2:38
mveDave Kreskowiak6-Oct-16 2:38 
QuestionConnections with My SQL Pin
Hermawan265-Oct-16 23:31
memberHermawan265-Oct-16 23:31 
SuggestionRe: Connections with My SQL Pin
Richard MacCutchan6-Oct-16 0:51
protectorRichard MacCutchan6-Oct-16 0:51 
GeneralRe: Connections with My SQL Pin
Hermawan266-Oct-16 16:45
memberHermawan266-Oct-16 16:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.