Click here to Skip to main content
14,733,443 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have the following XML file:
<?xml version="1.0"?>
<company>
<companyname>
<group>Accenture BPO</group>
<group>Accenture IT </group>
<group>Accenture Infotech</group>
</companyname>
<companyname>HCL</companyname>
</company> 

How would I store it in a database table ?
Posted
Updated 19-Oct-20 9:03am
v3
Comments
OriginalGriff 15-Dec-10 4:08am
   
Answer updated

We do not do your homework for you.
Try it yourself, and if you get stuck, ask us then.
But don't expect us to hand it to you on a plate!


"Is there any way i can ask all my queries BY PAYING YOU dear ?? - shikhar gilhotra 27 mins ago


No.
1) That would defeat the purpose of the exercise. It would become "Who has the most money" rather than "who actually knows something, and can do teh job".
2) You couldn't afford me.
   
v2
Comments
shikhar gilhotra 15-Dec-10 3:38am
   
Is there any way i can ask all my queries BY PAYING YOU dear ??
Hiren solanki 15-Dec-10 3:40am
   
@shikar : Yes send 1 million to my paypal acc for solving it.

My suggestion would be to not became rude in any case, People are doing their work in free time here, Just wait for answer or follow the suggestion.
shikhar gilhotra 15-Dec-10 4:18am
   
See I am new but i always try my best to resolve it , my friend . But when i failed then only i wrote the query here...and look at you..More than a RESOLUTION, i recieved NOTHING
fjdiewornncalwe 25-Dec-10 18:27pm
   
@shikhar... You receive nothing because you don't explain anything to us about what you try. I'll give you the benefit of the doubt here that you actually did try. Explain to us what you did try and where it went wrong for you. There are literally hundreds of experienced minds here who would be willing to help in that situation.
Well, another interview question of yours!
for head start, the question is asking you to design a table structure such that the above xml data can be saved easily.

Think of company table & Group table with Associated table if needed.
   
You can use
JJsonsoft/Newtonsoft
framework.
It helps you to migrate xml data into database.
This framework is used to move multiple type of collections
into multiple type of databases.
JXmlMySQLDataAdapter

It Provides you multiple type of data adapters.
For example,
MySqlDataAdapter.PM_MigrateInDBConnStr

Which is generic for any type,
And it will help you to put particular data in particular database.

For your reference[^]
   
Comments
Dave Kreskowiak 20-Oct-20 0:46am
   
I seriously doubt the OP is still doing their homework assignment 10 years later.
You can use
JJsonsoft/Newtonsoft
framework.
It helps you to migrate xml data into database.
This framework is used to move multiple type of collections
into multiple type of databases.
JXmlMySQLDataAdapter

It Provides you multiple type of data adapters.
For example,
MySqlDataAdapter.PM_MigrateInDBConnStr

Which is generic for any type,
And it will help you to put particular data in particular database.

For your reference[^]
   

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