How can we convert XML Data to DataBase Table in C#.Net?

Answers were Sorted based on User's Feedback



How can we convert XML Data to DataBase Table in C#.Net?..

Answer / babar shaik

using System.XML;

We can fill the Dataset using

Ds.ReadXML();

Then Update the Data into Database.

Is This Answer Correct ?    13 Yes 5 No

How can we convert XML Data to DataBase Table in C#.Net?..

Answer / arindamrudra

If the XML Document comes like this

@XmlDocument ='<PARAMS><STATIC><INTERVIEWDATETIME>2/13/2009</INTERVIEWDATETIME></STATIC></PARAMS>'

We will have to write

EXEC sp_xml_preparedocument @docHandle OUTPUT, @XmlDocument

@docHandle and @XmlDocument are variable of datatype int and XML respectively.


then we have to use the similar type of code to get the value from XML and the variables should be taken on the basis of the datatype coming from the XML.

DECLARE @date1 DATETIME
SELECT
@date1=Date11
FROM OPENXML(@docHandle, 'PARAMS/STATIC', 1)
WITH
(Date11 DATETIME 'INTERVIEWDATETIME')
EXEC sp_xml_removedocument @docHandle

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C Sharp Interview Questions

what happens if you inherit multiple interfaces and they have conflicting method names?

0 Answers   Siebel Systems,


What are the classes contained in a single .NET DLL ?

0 Answers   Siebel,


What is scope c#?

0 Answers  


What are the various components in crystal reports?

0 Answers  


What is the purpose of namespace in c#?

0 Answers  


how to change a value of particular cell in a data grid

3 Answers  


Can c# inherit multiple classes?

0 Answers  


What is the differences between datagrid, datalist and repeater in .net?

0 Answers  


What is ulong in c#?

0 Answers  


How can we set the class to be inherited, but prevent the method from being over-ridden?

0 Answers  


hi In my database i put id column as identity(the database is incremented by it self only)what i want is if i enter a data in my website, id will come automatically can u pl z tell me the code thax in advance

1 Answers  


What is the implicit name of the parameter that gets passed into the set method/property of a class?

0 Answers   Siebel,


Categories