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();
                CarrierSchema ds = new CarrierSchema();

                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 = "CarriersDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                return(type);
            }
        public override DataSet Clone()
        {
            CarrierSchema cln = ((CarrierSchema)(base.Clone()));

            cln.InitVars();
            return(cln);
        }
        public override System.Data.DataSet Clone()
        {
            CarrierSchema cln = ((CarrierSchema)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
        public static System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(System.Xml.Schema.XmlSchemaSet xs)
        {
            CarrierSchema ds = new CarrierSchema();

            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);
        }
Beispiel #5
0
 /// <summary>
 /// Methods returns the requested Carriers. If Local is true it returns the
 /// local providers. If local is false it returns the long distance providers.
 /// </summary>
 /// <param name="siteId"></param>
 /// <param name="local"></param>
 /// <returns></returns>
 public CarrierSchema.CarriersDataTable GetCarriers(int siteId, bool local)
 {
     try
     {
         using (SqlConnection sqlConnection = new SqlConnection(_connectionString))
         {
             // open connection
             try{ sqlConnection.Open(); }
             catch { throw new LogonException(); }
             // now setup the command object.
             string procName = local?"spGetCarriersIntraLata":"spGetCarriersInterLata";
             using (SqlCommand cmd = new SqlCommand(procName, sqlConnection))
             {
                 // build the command object
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@siteId", SqlDbType.Int).Value = siteId;
                 // build the dataadapter
                 SqlDataAdapter da = new SqlDataAdapter(cmd);
                 // create the dataset to fill
                 CarrierSchema ds = new CarrierSchema();
                 da.Fill(ds.Carriers);
                 // all done, return results.
                 return(ds.Carriers);
             }
         }
     }
     catch (DataSourceException)
     {
         // just rethrow it. it is from our internal code block
         throw;
     }
     catch (Exception ex)
     {
         // DataSourceException.
         throw new DataSourceException(ex);
     }
 }