Click here to Skip to main content
14,668,470 members
Rate this:
Please Sign up or sign in to vote.
See more:
Dear Sir,
I have text file which having data like as:
<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.

Rate this:
Please Sign up or sign in to vote.

Solution 1

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
   
Comments
Bhanu Pratap Verma 27-Jun-14 7:43am
   
Dear You very much for your reply. I solved it.
Rate this:
Please Sign up or sign in to vote.

Solution 2

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)
   
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, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100