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(); dsOracle ds = new dsOracle(); 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 = "dtOracleDataTable"; type.Attributes.Add(attribute2); type.Particle = sequence; return(type); }
public override System.Data.DataSet Clone() { dsOracle cln = ((dsOracle)(base.Clone())); cln.InitVars(); cln.SchemaSerializationMode = this.SchemaSerializationMode; return(cln); }
public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs) { dsOracle ds = new dsOracle(); 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) { // connection string string cnString = "User Id=hr;Password=hr;Data Source=XE"; OracleConnection conReport = new OracleConnection(cnString); OracleCommand cmdReport = new OracleCommand(); OracleDataReader drReport; DataSet dsReport = new dsOracle(); try { // open connection conReport.Open(); cmdReport.CommandType = CommandType.Text; cmdReport.Connection = conReport; cmdReport.CommandText = "SELECT first_name, last_name, salary FROM EMP_DETAILS_VIEW"; // execute query and load result to dataset drReport = cmdReport.ExecuteReader(); dsReport.Tables[0].Load(drReport); // close connection drReport.Close(); conReport.Close(); // prepare report for view reportViewer1.LocalReport.ReportEmbeddedResource = "OracleReport.rptOracle.rdlc"; ReportDataSource rds = new ReportDataSource(); rds.Name = "dsOracle_dtOracle"; rds.Value = dsReport.Tables[0]; reportViewer1.LocalReport.DataSources.Add(rds); // preivew the report reportViewer1.RefreshReport(); } catch (OracleException ex) { MessageBox.Show(ex.Message); } finally { if (conReport.State == ConnectionState.Open) { conReport.Close(); } } }