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:


SET @xmlCase = '

<case xsi="<a href="></a>">







<assignedon nil="true">



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: