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 ControlBox Propertie

0 Answers   MCN Solutions,


What is append in c#?

0 Answers  


Is hashset serializable c#?

0 Answers  


What is appdomain in c#?

0 Answers  


What is serialization in dot net?

0 Answers  






Does c# do array bounds checking?

0 Answers  


What is the default value of boolean variable?

0 Answers  


why c# is pronounced as C-sharp instead of pronouncing it as C-hash? is there any technical reason behind it?

3 Answers  


What is meant by desktop application?

0 Answers  


What are the types of operator?

0 Answers  


What is the gac, and where is it located?

1 Answers  


How to print labels in windows form in C# .net

5 Answers  


Categories