public static System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(System.Xml.Schema.XmlSchemaSet xs) { System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType(); System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence(); dsDashboard ds = new dsDashboard(); xs.Add(ds.GetSchemaSerializable()); System.Xml.Schema.XmlSchemaAny any1 = new System.Xml.Schema.XmlSchemaAny(); any1.Namespace = "http://www.w3.org/2001/XMLSchema"; any1.MinOccurs = new decimal(0); any1.MaxOccurs = decimal.MaxValue; any1.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any1); System.Xml.Schema.XmlSchemaAny any2 = new System.Xml.Schema.XmlSchemaAny(); any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1"; any2.MinOccurs = new decimal(1); any2.ProcessContents = System.Xml.Schema.XmlSchemaContentProcessing.Lax; sequence.Items.Add(any2); System.Xml.Schema.XmlSchemaAttribute attribute1 = new System.Xml.Schema.XmlSchemaAttribute(); attribute1.Name = "namespace"; attribute1.FixedValue = ds.Namespace; type.Attributes.Add(attribute1); System.Xml.Schema.XmlSchemaAttribute attribute2 = new System.Xml.Schema.XmlSchemaAttribute(); attribute2.Name = "tableTypeName"; attribute2.FixedValue = "dtDashboardDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; return(type); }
public override System.Data.DataSet Clone() { dsDashboard cln = ((dsDashboard)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) { dsDashboard ds = new dsDashboard(); System.Xml.Schema.XmlSchemaComplexType type = new System.Xml.Schema.XmlSchemaComplexType(); System.Xml.Schema.XmlSchemaSequence sequence = new System.Xml.Schema.XmlSchemaSequence(); xs.Add(ds.GetSchemaSerializable()); System.Xml.Schema.XmlSchemaAny any = new System.Xml.Schema.XmlSchemaAny(); any.Namespace = ds.Namespace; sequence.Items.Add(any); type.Particle = sequence; return(type); }
private void Form1_Load(object sender, EventArgs e) { System.Uri uri = new Uri(@"http://rss.news.yahoo.com/rss/topstories"); XmlDocument doc = new XmlDocument(); using (XmlReader reader = XmlReader.Create(uri.ToString())) { doc.Load(reader); reader.Close(); } XmlNodeList title = doc.GetElementsByTagName("title"); XmlNodeList link = doc.GetElementsByTagName("link"); // get reference of typed DataSet dsDashboard dsRSS = new dsDashboard(); // get row information from typed DataSet dsDashboard.dtDashboardRow dtRSS; // add four rows to DataSet for (int i = 1; i < 6; ++i) { dtRSS = dsRSS.dtDashboard.NewdtDashboardRow(); dtRSS.NewsTitle = title[i].InnerText; dtRSS.NewsLink = link[i].InnerText; dsRSS.dtDashboard.AdddtDashboardRow(dtRSS); } // Specify report path reportViewer1.LocalReport.ReportEmbeddedResource = "MyDashboard.rptDashboard.rdlc"; ReportDataSource rds = new ReportDataSource(); reportViewer1.LocalReport.EnableExternalImages = true; reportViewer1.LocalReport.EnableHyperlinks = true; rds.Name = "dsDashboard_dtDashboard"; rds.Value = dsRSS.Tables[0]; reportViewer1.LocalReport.DataSources.Add(rds); reportViewer1.RefreshReport(); }