Re: Performance and Scalability of SqlXml
From: Tilli (tilli_at_weissenberger._no_spam_at)
Date: 04/05/04
- Previous message: Irwin Dolobowsky[MS]: "Re: Displaying XML in webbrowser"
- In reply to: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
- Next in thread: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
- Reply: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
- Reply: Chandra Kalyanaraman [MSFT]: "Re: Performance and Scalability of SqlXml"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 05 Apr 2004 11:42:43 -0700
Hi,
Not sure what you mean. I am retrieving 9 tables at the same time, so I
wouldn't be retrieving that with SqlDataReader, but instead using a
DataSet so I'd have the 9 Tables loaded.
If you like to see my SqlXml code for loading the data per XML:
public XmlDocument GetXml(DB.DBPermissions perms, SqlXmlCommandType
cmdType, string tplFName, string query, string rootTag) {
XmlDocument objXML = null;
string tpl =
ConfigurationSettings.AppSettings[""+Common.AppSettings.SQLXMLBaseDir] +
tplFName;
if (!File.Exists(tpl)) {
Common.Trace(TraceLevel.Error, "XmlSql Template '" + tpl + "' not
found!", "XmlF.GetXml");
return null;
}
SqlXmlCommand cmd = new SqlXmlCommand( DB.Source(perms) );
cmd.CommandType = cmdType;
if (cmdType == SqlXmlCommandType.TemplateFile) {
cmd.CommandText = tpl;
} else if (cmdType == SqlXmlCommandType.XPath) {
cmd.CommandText = query;
cmd.SchemaPath = tpl;
}
cmd.RootTag = rootTag;
//double started = DateTime.Now.TimeOfDay.TotalMilliseconds;
using (Stream strm = cmd.ExecuteStream()) {
using (StreamReader sr = new StreamReader(strm)) {
string xml = sr.ReadToEnd();
try {
objXML = new XmlDocument();
objXML.LoadXml(xml);
} catch (Exception err) {
Common.Trace(TraceLevel.Warning, "Error converting result '" +
xml + "'to Xml (from template '" + tpl + "')", "XmlF.GetXml");
return null;
}
}
}
//Debug.WriteLine("\r\n>> SqlXml.NET TOOK: " +
(DateTime.Now.TimeOfDay.TotalMilliseconds-started) + "ms");
return objXML;
}
thanks for your input, though! Please be patient with me ;)
regards, Tilli
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
- Previous message: Irwin Dolobowsky[MS]: "Re: Displaying XML in webbrowser"
- In reply to: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
- Next in thread: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
- Reply: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
- Reply: Chandra Kalyanaraman [MSFT]: "Re: Performance and Scalability of SqlXml"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|