Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Sir,
I have text file which having data like as:
XML
<CHPQI02>
        <BEMAST>
            <BENo>1234567<END-BENo>
            <BEDate>02/07/1984<END-BEDate>
        <END-BEMAST>

        <BEIGM>
             <IGNNo>568998555<END-IGNNo>
             <IGNDate>568998555<END-IGNDate>
        <END-BEIGM>

        <BECONT>
            <BE>5<END-BE>
        <END-BECONT>

        <BEITEM>
             <HSCODE>285001<END-HSCODE>
             <ItemDesc>Fresh food<END-ItemDesc>
        <END-BEITEM>

<END-CHPQI02>


I already read data in string variable and now I want to stored it in database ,How to do it please suggest me.

Thank you in advance.
Posted
Comments
phil.o 20-Sep-13 2:42am    
Just a question: why not using the XML format as your source file? It would make your import task much easier.
If you are not responsible for this nonsense source format, you are allowed to rant violently against the one who is :)
Bhanu Pratap Verma 27-Jun-14 7:42am    
Dear the format sent by client and they have only format like that. because they are using same format in multiple projects so we can not violent against him.

What you want to store? entire text file? or individual fields in database. please elaborate with proper explanation.

If you need to store individual field then its very simple.

Thanks
Keyur
 
Share this answer
 
Comments
Bhanu Pratap Verma 27-Jun-14 7:43am    
Dear You very much for your reply. I solved it.
I want to store data which inside the tags In the tables .

The Tables structure as

Table1 : BEMAST(BENo,BEDate)
Table2 : BEIGM(IGNNo,BEDate)
Table3 : BECONT(BE)
Table4 : BEITEM(HSCODE,ItemDesc)
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 26-Jun-14 13:50pm    
Please stop posting fake "answers". This is the abuse.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900