/// <summary> /// Get the named property value from the XML document /// </summary> /// <param name="propertyName">The name of the property to get</param> /// <returns>The property value</returns> public object GetDocumentPropertyValue(string propertyName) { object result = null; STParameters param = new STParameters(this.Document); param.GetBaseParam(propertyName, ref result); return(result); }
/// <summary> /// Set the named property value in the XML document /// </summary> /// <param name="propertyName">The name of the property to set</param> /// <param name="propertyValue">The property value</param> public void SetDocumentPropertyValue(string propertyName, string propertyValue) { STParameters param = new STParameters(this.Document); param.SetParam(propertyName, propertyValue); }
/// <summary> /// loads data into internal members from the XML document and detects the server type /// [SQL, OLAP etc] based on the info in the XML doc /// </summary> public virtual void LoadData() { STParameters param; bool bStatus; param = new STParameters(); param.SetDocument(m_doc); // DEVNOTE: chrisze 02/25/03 // This is an ugly way to distinguish between different server types // Maybe we should pass server type as one of the parameters? // bStatus = param.GetParam("servername", ref this.serverName); if (!bStatus || this.serverName.Length == 0) { { bStatus = param.GetParam("database", ref this.sqlceFilename); if (bStatus && !String.IsNullOrEmpty(this.sqlceFilename)) { this.serverType = ServerType.SQLCE; } else if (this.sqlCiWithConnection != null) { this.serverType = ServerType.SQL; } else { this.serverType = ServerType.UNKNOWN; } } } else { //OK, let's see if <servertype> was specified in the parameters. It it was, use //it to double check that it is SQL string specifiedServerType = ""; bStatus = param.GetParam("servertype", ref specifiedServerType); if (bStatus) { if (specifiedServerType != null && "sql" != specifiedServerType.ToLowerInvariant()) { this.serverType = ServerType.UNKNOWN;//we know only about 3 types, and 2 of them were excluded by if branch above } else { this.serverType = ServerType.SQL; } } else { this.serverType = ServerType.SQL; } } // Ensure there is no password in the XML document string temp = String.Empty; if (param.GetParam("password", ref temp)) { temp = null; throw new SecurityException(); } if (ServerType.SQL == this.serverType) { this.InitializeObjectNameAndSchema(); } }