Re: Performance and Scalability of SqlXml

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Tilli (tilli_at_weissenberger._no_spam_at)
Date: 04/05/04

  • Next message: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"
    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!


  • Next message: Irwin Dolobowsky[MS]: "Re: Performance and Scalability of SqlXml"

    Relevant Pages

    • Re: CListctrl::GetItemData causing problem
      ... You show us where you are retrieving the string, ... just a guess, is that you are putting a completely useless value in when you InsertItem, ... I am working in visual studio 2005 environment. ...
      (microsoft.public.vc.mfc)
    • Re: How to use P3Admin to create email accounts?
      ... Retrieving the COM class factory for component with CLSID ... string UserName, string DomainName, string Password) ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: Path command
      ... function after retrieving the full name with the GetOpenFileName ... > Dim strFile As String, strPath As String, i As Long, j As Long ... > MsgBox strPath ... >> including filename. ...
      (microsoft.public.excel.programming)
    • Re: Active Directory information
      ... string attribute, even though there is never more than one value. ... Depending ... on how you are retrieving the value this can make a difference. ... MVP Directory Services ...
      (microsoft.public.scripting.vbscript)
    • Re: left, mid and right in vb.net
      ... You seem to be retrieving the middle part of a string from a textbox entry, ... You may get an error if you try to retrieve letters from a string when there ... Regards ...
      (microsoft.public.dotnet.languages.vb)