예제 #1
0
        static internal List <SqlColumn> GetSqlColumns(DesignXmlDraw d, string ds, string sql)
        {
            XmlNode dsNode = d.DataSourceName(ds);

            if (dsNode == null)
            {
                return(null);
            }
            string  dataProvider;
            string  connection;
            XmlNode dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "DataProvider");

            if (dp == null)
            {
                return(null);
            }
            dataProvider = dp.InnerText;
            dp           = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "ConnectString");
            if (dp == null)
            {
                return(null);
            }
            connection = dp.InnerText;
            IList parameters = null;

            return(GetSqlColumns(dataProvider, connection, sql, parameters));
        }
예제 #2
0
        static internal List <SqlSchemaInfo> GetSchemaInfo(DesignXmlDraw d, string ds)
        {
            XmlNode dsNode = d.DataSourceName(ds);

            if (dsNode == null)
            {
                return(null);
            }

            string  dataProvider;
            string  connection;
            XmlNode dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "DataProvider");

            if (dp == null)
            {
                return(null);
            }
            dataProvider = dp.InnerText;
            dp           = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "ConnectString");
            if (dp == null)
            {
                return(null);
            }
            connection = dp.InnerText;
            return(GetSchemaInfo(dataProvider, connection));
        }
        static internal bool GetConnnectionInfo(DesignXmlDraw d, string ds, out string dataProvider, out string connection)
        {
            XmlNode dsNode = d.DataSourceName(ds);

            dataProvider = null;
            connection   = null;
            if (dsNode == null)
            {
                return(false);
            }

            string dataSourceReference = d.GetElementValue(dsNode, "DataSourceReference", null);

            if (dataSourceReference != null)
            {
                //  This is not very pretty code since it is assuming the structure of the windows parenting.
                //    But there isn't any other way to get this information from here.
                Control  p  = d;
                MDIChild mc = null;
                while (p != null && !(p is RdlDesigner))
                {
                    if (p is MDIChild)
                    {
                        mc = (MDIChild)p;
                    }

                    p = p.Parent;
                }
                if (p == null || mc == null || mc.SourceFile == null)
                {
                    MessageBox.Show("Unable to locate DataSource Shared file.  Try saving report first");
                    return(false);
                }
                string filename = Path.GetDirectoryName(mc.SourceFile) + Path.DirectorySeparatorChar + dataSourceReference;
                if (!DesignerUtility.GetSharedConnectionInfo((DesignerForm)p, filename, out dataProvider, out connection))
                {
                    return(false);
                }
            }
            else
            {
                XmlNode dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "DataProvider");
                if (dp == null)
                {
                    return(false);
                }
                dataProvider = dp.InnerText;
                dp           = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "ConnectString");
                if (dp == null)
                {
                    return(false);
                }
                connection = dp.InnerText;
            }
            return(true);
        }
예제 #4
0
파일: DesignerUtility.cs 프로젝트: mnisl/OD
        static internal List<SqlSchemaInfo> GetSchemaInfo(DesignXmlDraw d, string ds)
		{
			XmlNode dsNode = d.DataSourceName(ds);
			if (dsNode == null)
				return null;

			string dataProvider;
			string connection;
			XmlNode dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "DataProvider");
			if (dp == null)
				return null;
			dataProvider = dp.InnerText;
			dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "ConnectString");
			if (dp == null)
				return null;
			connection = dp.InnerText;
			return GetSchemaInfo(dataProvider, connection);
		}
예제 #5
0
파일: DesignerUtility.cs 프로젝트: mnisl/OD
        static internal List<SqlColumn> GetSqlColumns(DesignXmlDraw d, string ds, string sql)
		{
			XmlNode dsNode = d.DataSourceName(ds);
			if (dsNode == null)
				return null;
			string dataProvider;
			string connection;
			XmlNode dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "DataProvider");
			if (dp == null)
				return null;
			dataProvider = dp.InnerText;
			dp = DesignXmlDraw.FindNextInHierarchy(dsNode, "ConnectionProperties", "ConnectString");
			if (dp == null)
				return null;
			connection = dp.InnerText;
			IList parameters=null;

			return GetSqlColumns(dataProvider, connection, sql, parameters);
		}