Home > Archive > MS SQL XML > November 2006 > Re: System.Data 1.1 / ADO.NET 1.1 and large datatypes introduced in SQL Server 2005









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: System.Data 1.1 / ADO.NET 1.1 and large datatypes introduced in SQL Server 2005
Kent Tegels

2006-11-21, 12:21 am

Hello Li-fan Chen,

L> How should we phrase the System.Data 1.1 access calls to feed an
L> variable containing XML to a SQL Server 2005 stored procedure?
L> What data type and length should be named on the System.Data 1.1
L> type?

If you mean as a parameter, type it as System.String.

L> Which data type should be used to return the XML datatype in the
L> select?
L> On the ADO.NET side, what should we cast the type to? How do we
L> access it?

If you are selecting from a table, ADO.NET will automatically type it as
a string for down-level clients. Suggest reading it as with ExecuteXMLReader
or just make it part of a table table.


L> If returning a -out or in-out parameter:
L> Which data type should be used to return the XML datatype
L> On the ADO.NET side, what should we cast the type to? How do we
L> access it?

String and string.

L> Not only do we worry about XML datatype, we wonder about varchar(max)
L> and nvarchar(max).

Essentially the same answers. From my experience, it just works if you treat
it as string in a filled DataTable or use an appropriate Execute method from
the Command object.

Thanks,
Kent Tegels
http://staff.develop.com/ktegels/


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com