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 is the advantage of singleton class?

0 Answers  


Why would you use a class property in c#?

0 Answers  


Can we call server-side code (c# or vb.net code) from javascript?

0 Answers  


What is addressof operator?

0 Answers  


What is COM Interoperability?

0 Answers   DELL,


Why is it efficient to use System.string under System.Text.StringBuilder ?

0 Answers   Siebel,


Are classes passed by reference in c#?

0 Answers  


Write a program to find the angle between the hours and minutes in a clock

0 Answers  


What is void in c#?

0 Answers  


What is a delegate in c#?

0 Answers  


Why objects are stored in heap in c#?

0 Answers  


Okay, so an int is a value type, and a class is a reference type. How can int be derived from object?

0 Answers  


Categories