P
prashant
Hi all,
i am working with .net 2.0 and sql server managment studio of
version--9.00.1399.00
for getting a xmldocument from a xml data in sqlserver ..
their is no error in this program but xmlreader returned by
line-->
"XmlReader xmlUser = xmlMain.CreateReader();
shows that xmlUser.HasValue is false but the "xmlMain" has the Xml
document...and the end result i am getting is null in XmlDocumnet named
userdoc....and thats not our requirment
the function is following:--
public static XmlDocument GetXmlDocument(string coloumName,
SqlDataReader sqlReader)
{
int ordinal = sqlReader.GetOrdinal(coloumName);
XmlDocument userDoc = new XmlDocument();
if (ordinal > 0)
{
SqlXml xmlMain = sqlReader.GetSqlXml(ordinal);
if (!xmlMain.IsNull)
{
XmlReader xmlUser = xmlMain.CreateReader();
if (xmlUser.HasValue)
{
userDoc.Load(xmlUser);
}
}
return userDoc;
Thanx in advance........
i am working with .net 2.0 and sql server managment studio of
version--9.00.1399.00
for getting a xmldocument from a xml data in sqlserver ..
their is no error in this program but xmlreader returned by
line-->
"XmlReader xmlUser = xmlMain.CreateReader();
shows that xmlUser.HasValue is false but the "xmlMain" has the Xml
document...and the end result i am getting is null in XmlDocumnet named
userdoc....and thats not our requirment
the function is following:--
public static XmlDocument GetXmlDocument(string coloumName,
SqlDataReader sqlReader)
{
int ordinal = sqlReader.GetOrdinal(coloumName);
XmlDocument userDoc = new XmlDocument();
if (ordinal > 0)
{
SqlXml xmlMain = sqlReader.GetSqlXml(ordinal);
if (!xmlMain.IsNull)
{
XmlReader xmlUser = xmlMain.CreateReader();
if (xmlUser.HasValue)
{
userDoc.Load(xmlUser);
}
}
return userDoc;
Thanx in advance........