How do I create a table in sql server using c# and xml?

I would like to create a persons table in sql server using c # with the xml file below.  The fields in the persons table need be   person_id, type and oneof.  How do I code this in c#.
 Am new to programming.

<?xml version="1.0" encoding="UTF-8"?>

-<root type="array">


-<persons>

<person_id>_:genid1</person_id>

<type>http://www.w3.org/2000/01/rdf-schema#Datatype</type>


-<oneofs>

<oneof>A|ASSUMED FRIEND|D|NONE SPECIFIED|F|FRIEND|H|HOSTILE|J|JOKER (Exercise Only - acting as a suspect)</oneof>

</oneofs>

</persons>


-<persons>

<person_id>_:genid108</person_id>

<type>http://www.w3.org/2000/01/rdf-schema#Datatype</type>


-<oneofs>

<oneof>Air Mission|Air Mission|Counter-Insurgency|Counter-Insurgencyt</oneof>

</oneofs>

</persons>
</root>
Edson FernandesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Aneesh RetnakaranDatabase AdministratorCommented:
Why cant you create the table in sql server first ? In most of the cases, the database user thru which the application connects to the database wont have sufficient permissions to create the tables.
0
Edson FernandesAuthor Commented:
I can create the database & table prior Agreed. I still need to create a stored procedure in sql server and then call that stored procedure in c#./
How do I do that?
0
Aneesh RetnakaranDatabase AdministratorCommented:
The following link will help you how to call a stored procedure

http://csharp-station.com/Tutorial/AdoDotNet/Lesson07

its the best practice to create all the database objects separately thru a sql script, this includes creating the databases tables indexes and stored procedures.
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
_agx_Commented:
(No points...)

Agreed.  For database design, use an IDE like SQL Server Management Studio for creating tables, procedures, etc... Then you can invoke the stored procedures from C#.

https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms
https://technet.microsoft.com/en-us/library/ms365247(v=sql.105).aspx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.