How can we convert XML Data to DataBase Table in C#.Net?
Answer Posted / 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 View All Answers
Explain 'structure padding'?
If a.equals(b) is true then a.gethashcode & b.gethashcode must always return same hash code.
We cannot create instances of static classes. Can we have constructors for static classes?
Explain what are three test cases you should go through in unit testing?
Why do we use threads in c#?
What is serialization in c#?
Which namespace is required to implement trace ?
What is the difference between first and firstordefault?
what is boxing and unboxing?can we initialize unboxing directly?
Why do we use public static void main in c#?
What is the difference between string and string in c#?
What is the usage of Enumeration in C# Programming and is it good to use or not ?
Is string value type c#?
Explain the process of polymorphism with an example?
What is sqladapter c#?