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

Can you put two constructor with the same structure in a class?

0 Answers  


What is predicate builder?

0 Answers  


Can we inherit an abstract class in another abstract class. If no why and If yes how..?

2 Answers  


What are predicates in c#?

0 Answers  


why instance? what are the uses of instance?

3 Answers   Choice Solutions,


What are Types of assemblies that can be created in dotnet

0 Answers  


What is a float?

0 Answers  


In languages without exception-handling facilities, we could send an error-handling procedure as a parameter to each procedure that can detect errors that must be handled. What disadvantages are there to this method?

0 Answers   HCL,


What is the difference between == and object.equals?

0 Answers  


Can class be protected in c#?

0 Answers  


What is the Difference between directcast and ctype?

1 Answers   Wipro,


How many types of constructors are there in c#?

0 Answers  


Categories