Geeks With Blogs
C# ASP.NET UTILS Programming blogus :-)

I'll give a sample in TSQL:
Here is the TSQL statement for getting a Case object that was Xml serialized:


DECLARE @xmlCase XML

SET @xmlCase = '

<case xsi="<a href=">http://www.w3.org/2001/XMLSchema-instance</a>">

<id>3b98cf5a-6faa-dd11-9299-001e0b8014eb</id>

<court>

<id>00000000-0000-0000-0000-000000000000</id>

     <courtregionid>00000000-0000-0000-0000-000000000000</courtregionid>

</court>

<createdon>2008-11-07T13:54:44.727+02:00</createdon>

<assignedon nil="true">

</case>

';




SELECT Cases.fields.value('(Id/text())[1]', 'UNIQUEIDENTIFIER') [Id_Cases],

Cases.fields.value('(Court/Id/text())[1]', 'UNIQUEIDENTIFIER') [CaseCourts_Id],

Cases.fields.value('(CaseRevisedTitle/text())[1]' , 'NVARCHAR(MAX)') [Title],

Cases.fields.value('(Title/text())[1]' , 'NVARCHAR(MAX)') [CaseNumber],

Cases.fields.value('(CaseTitle/text())[1]' , 'NVARCHAR(MAX)') [CaseTitle],

CAST(LEFT(Cases.fields.value('(CreatedOn/text())[1]', 'NVARCHAR(MAX)'), 19) AS DATETIME) [CreatedOn],

CAST(LEFT(Cases.fields.value('(AssignedOn/text())[1]', 'NVARCHAR(MAX)'), 19) AS DATETIME) [AssignedOn]

INTO [#Cases] FROM @xmlCase.nodes('/Case') Cases(fields);


SELECT * FROM [#Cases]

HTH :-)
Posted on Wednesday, November 19, 2008 12:01 AM How to ASP.NET C#? | Back to top


Comments on this post: How to pass C# object to sql procedure?

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Diadiora Alexandru | Powered by: GeeksWithBlogs.net