本文整理汇总了C#中System.Data.DataSet.ReadXmlSchema方法的典型用法代码示例。如果您正苦于以下问题:C# System.Data.DataSet.ReadXmlSchema方法的具体用法?C# System.Data.DataSet.ReadXmlSchema怎么用?C# System.Data.DataSet.ReadXmlSchema使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Data.DataSet
的用法示例。
在下文中一共展示了System.Data.DataSet.ReadXmlSchema方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmployeeDataSet
protected EmployeeDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["employee"] != null)) {
base.Tables.Add(new employeeDataTable(ds.Tables["employee"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
示例2: FullDataSet
protected FullDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["Product"] != null)) {
base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
}
if ((ds.Tables["Country"] != null)) {
base.Tables.Add(new CountryDataTable(ds.Tables["Country"]));
}
if ((ds.Tables["FarmGroup"] != null)) {
base.Tables.Add(new FarmGroupDataTable(ds.Tables["FarmGroup"]));
}
if ((ds.Tables["FarmGroupLevel2"] != null)) {
base.Tables.Add(new FarmGroupLevel2DataTable(ds.Tables["FarmGroupLevel2"]));
}
if ((ds.Tables["Manufacturer"] != null)) {
base.Tables.Add(new ManufacturerDataTable(ds.Tables["Manufacturer"]));
}
if ((ds.Tables["Packing"] != null)) {
base.Tables.Add(new PackingDataTable(ds.Tables["Packing"]));
}
if ((ds.Tables["StorageCondition"] != null)) {
base.Tables.Add(new StorageConditionDataTable(ds.Tables["StorageCondition"]));
}
if ((ds.Tables["Unit"] != null)) {
base.Tables.Add(new UnitDataTable(ds.Tables["Unit"]));
}
if ((ds.Tables["Substance"] != null)) {
base.Tables.Add(new SubstanceDataTable(ds.Tables["Substance"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
this.InitExpressions();
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
示例3: NorthwindDataSet
protected NorthwindDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((strSchema != null)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["Products"] != null)) {
base.Tables.Add(new ProductsDataTable(ds.Tables["Products"]));
}
if ((ds.Tables["Orders"] != null)) {
base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
}
if ((ds.Tables["Suppliers"] != null)) {
base.Tables.Add(new SuppliersDataTable(ds.Tables["Suppliers"]));
}
if ((ds.Tables["Shippers"] != null)) {
base.Tables.Add(new ShippersDataTable(ds.Tables["Shippers"]));
}
if ((ds.Tables["Customers"] != null)) {
base.Tables.Add(new CustomersDataTable(ds.Tables["Customers"]));
}
if ((ds.Tables["Categories"] != null)) {
base.Tables.Add(new CategoriesDataTable(ds.Tables["Categories"]));
}
if ((ds.Tables["Order Details"] != null)) {
base.Tables.Add(new Order_DetailsDataTable(ds.Tables["Order Details"]));
}
if ((ds.Tables["Employees"] != null)) {
base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.BeginInit();
this.InitClass();
this.EndInit();
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
示例4: CreateDataset
public static System.Data.DataSet CreateDataset(string datasetName)
{
try
{
System.Data.DataSet ds = Feng.Utils.ReflectionHelper.CreateInstanceFromName(datasetName) as System.Data.DataSet;
if (ds != null)
return ds;
}
catch (Exception)
{
}
ResourceContent dataSetXmlSchema = ResourceInfoHelper.ResolveResource(datasetName, ResourceType.Dataset);
if (dataSetXmlSchema != null)
{
switch (dataSetXmlSchema.Type)
{
case ResourceContentType.File:
{
System.Data.DataSet ds = new System.Data.DataSet();
using (System.IO.StreamReader sr = new System.IO.StreamReader(dataSetXmlSchema.Content.ToString()))
{
ds.ReadXmlSchema(sr);
}
return ds;
}
case ResourceContentType.String:
{
System.Data.DataSet ds = new System.Data.DataSet();
using (System.IO.StringReader sr = new System.IO.StringReader(dataSetXmlSchema.Content.ToString()))
{
ds.ReadXmlSchema(sr);
}
return ds;
}
default:
throw new ArgumentException("Invalid Resource Content Type!");
}
}
else
{
throw new ArgumentException(string.Format("Can't find resouce of {0}!", datasetName));
}
}
示例5: btGenerate_Click
private void btGenerate_Click(object sender, System.EventArgs e)
{
try
{
System.Data.DataSet ds = new System.Data.DataSet();
using (System.IO.MemoryStream stream = new System.IO.MemoryStream())
{
System.IO.StreamWriter writer = new System.IO.StreamWriter(stream, System.Text.Encoding.Unicode);
writer.Write(txtDatasetDefinition.Text);
writer.Flush();
stream.Seek(0, System.IO.SeekOrigin.Begin);
ds.ReadXmlSchema(stream);
writer.Close();
}
System.Text.StringBuilder outText = new System.Text.StringBuilder();
outText.Append("--SQL Command builder\r\n");
foreach (System.Data.DataTable table in ds.Tables)
{
outText.Append("-- Table : " + table.TableName + "\r\n");
DevAge.Data.SqlClient.SqlCommandBuilder cmdBuilder = new DevAge.Data.SqlClient.SqlCommandBuilder(table);
outText.AppendLine(cmdBuilder.GetDeleteCommand().CommandText);
outText.AppendLine(cmdBuilder.GetUpdateCommand().CommandText);
outText.AppendLine(cmdBuilder.GetInsertCommand().CommandText);
outText.Append("-- ############################################################\r\n");
}
txtSqlOutput.Text = outText.ToString();
}
catch(Exception ex)
{
MessageBox.Show(this, ex.Message);
}
}
示例6: c00_ds
protected c00_ds(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["tbl_TaniBlg"] != null)) {
base.Tables.Add(new tbl_TaniBlgDataTable(ds.Tables["tbl_TaniBlg"]));
}
if ((ds.Tables["tblKonsultasyonBilgisi"] != null)) {
base.Tables.Add(new tblKonsultasyonBilgisiDataTable(ds.Tables["tblKonsultasyonBilgisi"]));
}
if ((ds.Tables["tbkBranj"] != null)) {
base.Tables.Add(new tbkBranjDataTable(ds.Tables["tbkBranj"]));
}
if ((ds.Tables["tbkHastaYatisBilgisi"] != null)) {
base.Tables.Add(new tbkHastaYatisBilgisiDataTable(ds.Tables["tbkHastaYatisBilgisi"]));
}
if ((ds.Tables["tblDisBilgisi"] != null)) {
base.Tables.Add(new tblDisBilgisiDataTable(ds.Tables["tblDisBilgisi"]));
}
if ((ds.Tables["tblAmeliyatveGirisimBilgisi"] != null)) {
base.Tables.Add(new tblAmeliyatveGirisimBilgisiDataTable(ds.Tables["tblAmeliyatveGirisimBilgisi"]));
}
if ((ds.Tables["tblTetkikveRadyolojiBilgisi"] != null)) {
base.Tables.Add(new tblTetkikveRadyolojiBilgisiDataTable(ds.Tables["tblTetkikveRadyolojiBilgisi"]));
}
if ((ds.Tables["tbkTahlilBilgisi"] != null)) {
base.Tables.Add(new tbkTahlilBilgisiDataTable(ds.Tables["tbkTahlilBilgisi"]));
}
if ((ds.Tables["tblDigerIslemBilgileri"] != null)) {
base.Tables.Add(new tblDigerIslemBilgileriDataTable(ds.Tables["tblDigerIslemBilgileri"]));
}
if ((ds.Tables["tblIlacBilgisi"] != null)) {
base.Tables.Add(new tblIlacBilgisiDataTable(ds.Tables["tblIlacBilgisi"]));
}
if ((ds.Tables["tblMalzemeBilgileri"] != null)) {
base.Tables.Add(new tblMalzemeBilgileriDataTable(ds.Tables["tblMalzemeBilgileri"]));
}
if ((ds.Tables["tblRaporBilgileri"] != null)) {
base.Tables.Add(new tblRaporBilgileriDataTable(ds.Tables["tblRaporBilgileri"]));
}
if ((ds.Tables["tblOdemeSorguHataBilgisi"] != null)) {
base.Tables.Add(new tblOdemeSorguHataBilgisiDataTable(ds.Tables["tblOdemeSorguHataBilgisi"]));
}
if ((ds.Tables["tblIslemFiyatBilgisi"] != null)) {
base.Tables.Add(new tblIslemFiyatBilgisiDataTable(ds.Tables["tblIslemFiyatBilgisi"]));
}
if ((ds.Tables["tblHastaTakipList"] != null)) {
base.Tables.Add(new tblHastaTakipListDataTable(ds.Tables["tblHastaTakipList"]));
}
if ((ds.Tables["tblFaturaBilgisi"] != null)) {
base.Tables.Add(new tblFaturaBilgisiDataTable(ds.Tables["tblFaturaBilgisi"]));
}
if ((ds.Tables["tblFaturaHataliKayit"] != null)) {
base.Tables.Add(new tblFaturaHataliKayitDataTable(ds.Tables["tblFaturaHataliKayit"]));
}
if ((ds.Tables["tblFaturaBasariliKayit"] != null)) {
base.Tables.Add(new tblFaturaBasariliKayitDataTable(ds.Tables["tblFaturaBasariliKayit"]));
}
if ((ds.Tables["tblTakipNumaralari"] != null)) {
base.Tables.Add(new tblTakipNumaralariDataTable(ds.Tables["tblTakipNumaralari"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
示例7: ExecuteQuery
private void ExecuteQuery(/*bool ShowWindow*/)
{
if (dsData != null)
{
dsData = null;
}
dsData = new System.Data.DataSet();
dsData.ReadXmlSchema("c:\\data.xsd");
dsData.ReadXml("c:\\data.xml");
if (_reporte != null)
{
// _reporte.SQL = SQL;
// _reporte.ReloadData();
_reporte.ReloadData(dsData);
}
if (_reporteRegadores != null)
{
ReporteRegadoresDataset rep = new ReporteRegadoresDataset();
rep.Process(dsData);
_reporteRegadores.ReloadData(rep.DataSet);
}
if (_rawDataForm != null)
{
_rawDataForm.DataSource = dsData;
}
}
示例8: MDataSet
protected MDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["Cash"] != null)) {
base.Tables.Add(new CashDataTable(ds.Tables["Cash"]));
}
if ((ds.Tables["DocumentType"] != null)) {
base.Tables.Add(new DocumentTypeDataTable(ds.Tables["DocumentType"]));
}
if ((ds.Tables["InvoiceMaster"] != null)) {
base.Tables.Add(new InvoiceMasterDataTable(ds.Tables["InvoiceMaster"]));
}
if ((ds.Tables["InvoiceDetail"] != null)) {
base.Tables.Add(new InvoiceDetailDataTable(ds.Tables["InvoiceDetail"]));
}
if ((ds.Tables["Periods"] != null)) {
base.Tables.Add(new PeriodsDataTable(ds.Tables["Periods"]));
}
if ((ds.Tables["ReceiptDetail"] != null)) {
base.Tables.Add(new ReceiptDetailDataTable(ds.Tables["ReceiptDetail"]));
}
if ((ds.Tables["ReceiptMaster"] != null)) {
base.Tables.Add(new ReceiptMasterDataTable(ds.Tables["ReceiptMaster"]));
}
if ((ds.Tables["ReceiptRemains"] != null)) {
base.Tables.Add(new ReceiptRemainsDataTable(ds.Tables["ReceiptRemains"]));
}
if ((ds.Tables["Product"] != null)) {
base.Tables.Add(new ProductDataTable(ds.Tables["Product"]));
}
if ((ds.Tables["Remains"] != null)) {
base.Tables.Add(new RemainsDataTable(ds.Tables["Remains"]));
}
if ((ds.Tables["Stock"] != null)) {
base.Tables.Add(new StockDataTable(ds.Tables["Stock"]));
}
if ((ds.Tables["LocalSetting"] != null)) {
base.Tables.Add(new LocalSettingDataTable(ds.Tables["LocalSetting"]));
}
if ((ds.Tables["Orders"] != null)) {
base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
}
if ((ds.Tables["inventoryMaster"] != null)) {
base.Tables.Add(new inventoryMasterDataTable(ds.Tables["inventoryMaster"]));
}
if ((ds.Tables["inventoryDetails"] != null)) {
base.Tables.Add(new inventoryDetailsDataTable(ds.Tables["inventoryDetails"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
this.InitExpressions();
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}
示例9: BinReadDataSetFromStream
private static void BinReadDataSetFromStream(System.IO.Stream stream, System.Data.DataSet ds, bool mergeSchema)
{
//Version
int version;
version = IO.StreamPersistence.ReadInt32(stream);
if (version != c_BinaryVersion)
throw new BinaryDataSetVersionException();
//Schema byte[]
System.Data.DataSet schemaDS; //Questo dataset viene usato solo per leggere lo schema
byte[] byteSchema = IO.StreamPersistence.ReadByteArray(stream);
using (System.IO.MemoryStream schemaStream = new System.IO.MemoryStream(byteSchema))
{
if (mergeSchema)
{
ds.ReadXmlSchema(schemaStream);
schemaDS = ds;
}
else
{
schemaDS = new System.Data.DataSet();
schemaDS.ReadXmlSchema(schemaStream);
}
}
//Tables
for (int iTable = 0; iTable < schemaDS.Tables.Count; iTable++)
{
System.Data.DataTable schemaTable = schemaDS.Tables[iTable];
//Table exist on the destination
if (ds.Tables.Contains( schemaTable.TableName ) )
{
System.Data.DataTable destinationTable = ds.Tables[ schemaTable.TableName ];
int rowsCount = IO.StreamPersistence.ReadInt32(stream);
//Rows
for (int r = 0; r < rowsCount; r++)
{
System.Data.DataRow row = destinationTable.NewRow();
//Columns
for (int c = 0; c < schemaTable.Columns.Count; c++)
{
string colName = schemaTable.Columns[c].ColumnName;
object val = BinReadFieldFromStream(stream, schemaTable.Columns[c].DataType); //Il valore viene comunque letto per far avanzare lo stream
if (destinationTable.Columns.Contains(colName))
row[ colName ] = val;
}
destinationTable.Rows.Add(row);
}
}
else //Note: if the table not exist I will read anyway the columns and rows to correctly position the stream on the next table
{
int rowsCount = IO.StreamPersistence.ReadInt32(stream);
//Rows
for (int r = 0; r < rowsCount; r++)
{
//Columns
for (int c = 0; c < schemaTable.Columns.Count; c++)
{
BinReadFieldFromStream(stream, schemaTable.Columns[c].DataType); //Il valore viene comunque letto per far avanzare lo stream
}
}
}
}
ds.AcceptChanges();
}
示例10: NorthwindDataSet
protected NorthwindDataSet(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["Categories"] != null)) {
base.Tables.Add(new CategoriesDataTable(ds.Tables["Categories"]));
}
if ((ds.Tables["CustomerCustomerDemo"] != null)) {
base.Tables.Add(new CustomerCustomerDemoDataTable(ds.Tables["CustomerCustomerDemo"]));
}
if ((ds.Tables["CustomerDemographics"] != null)) {
base.Tables.Add(new CustomerDemographicsDataTable(ds.Tables["CustomerDemographics"]));
}
if ((ds.Tables["Customers"] != null)) {
base.Tables.Add(new CustomersDataTable(ds.Tables["Customers"]));
}
if ((ds.Tables["Employees"] != null)) {
base.Tables.Add(new EmployeesDataTable(ds.Tables["Employees"]));
}
if ((ds.Tables["EmployeeTerritories"] != null)) {
base.Tables.Add(new EmployeeTerritoriesDataTable(ds.Tables["EmployeeTerritories"]));
}
if ((ds.Tables["Order Details"] != null)) {
base.Tables.Add(new Order_DetailsDataTable(ds.Tables["Order Details"]));
}
if ((ds.Tables["Orders"] != null)) {
base.Tables.Add(new OrdersDataTable(ds.Tables["Orders"]));
}
if ((ds.Tables["Products"] != null)) {
base.Tables.Add(new ProductsDataTable(ds.Tables["Products"]));
}
if ((ds.Tables["Region"] != null)) {
base.Tables.Add(new RegionDataTable(ds.Tables["Region"]));
}
if ((ds.Tables["Shippers"] != null)) {
base.Tables.Add(new ShippersDataTable(ds.Tables["Shippers"]));
}
if ((ds.Tables["Suppliers"] != null)) {
base.Tables.Add(new SuppliersDataTable(ds.Tables["Suppliers"]));
}
if ((ds.Tables["Territories"] != null)) {
base.Tables.Add(new TerritoriesDataTable(ds.Tables["Territories"]));
}
if ((ds.Tables["Alphabetical list of products"] != null)) {
base.Tables.Add(new Alphabetical_list_of_productsDataTable(ds.Tables["Alphabetical list of products"]));
}
if ((ds.Tables["Category Sales for 1997"] != null)) {
base.Tables.Add(new Category_Sales_for_1997DataTable(ds.Tables["Category Sales for 1997"]));
}
if ((ds.Tables["Current Product List"] != null)) {
base.Tables.Add(new Current_Product_ListDataTable(ds.Tables["Current Product List"]));
}
if ((ds.Tables["Customer and Suppliers by City"] != null)) {
base.Tables.Add(new Customer_and_Suppliers_by_CityDataTable(ds.Tables["Customer and Suppliers by City"]));
}
if ((ds.Tables["Invoices"] != null)) {
base.Tables.Add(new InvoicesDataTable(ds.Tables["Invoices"]));
}
if ((ds.Tables["Order Details Extended"] != null)) {
base.Tables.Add(new Order_Details_ExtendedDataTable(ds.Tables["Order Details Extended"]));
}
if ((ds.Tables["Order Subtotals"] != null)) {
base.Tables.Add(new Order_SubtotalsDataTable(ds.Tables["Order Subtotals"]));
}
if ((ds.Tables["Orders Qry"] != null)) {
base.Tables.Add(new Orders_QryDataTable(ds.Tables["Orders Qry"]));
}
if ((ds.Tables["Product Sales for 1997"] != null)) {
base.Tables.Add(new Product_Sales_for_1997DataTable(ds.Tables["Product Sales for 1997"]));
}
if ((ds.Tables["Products Above Average Price"] != null)) {
base.Tables.Add(new Products_Above_Average_PriceDataTable(ds.Tables["Products Above Average Price"]));
}
if ((ds.Tables["Products by Category"] != null)) {
base.Tables.Add(new Products_by_CategoryDataTable(ds.Tables["Products by Category"]));
}
if ((ds.Tables["Quarterly Orders"] != null)) {
base.Tables.Add(new Quarterly_OrdersDataTable(ds.Tables["Quarterly Orders"]));
}
if ((ds.Tables["Sales by Category"] != null)) {
base.Tables.Add(new Sales_by_CategoryDataTable(ds.Tables["Sales by Category"]));
}
if ((ds.Tables["Sales Totals by Amount"] != null)) {
base.Tables.Add(new Sales_Totals_by_AmountDataTable(ds.Tables["Sales Totals by Amount"]));
}
if ((ds.Tables["Summary of Sales by Quarter"] != null)) {
base.Tables.Add(new Summary_of_Sales_by_QuarterDataTable(ds.Tables["Summary of Sales by Quarter"]));
}
if ((ds.Tables["Summary of Sales by Year"] != null)) {
base.Tables.Add(new Summary_of_Sales_by_YearDataTable(ds.Tables["Summary of Sales by Year"]));
}
//.........这里部分代码省略.........
示例11: PACKINGLIST
protected PACKINGLIST(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["PACK_ID"] != null)) {
base.Tables.Add(new PACK_IDDataTable(ds.Tables["PACK_ID"]));
}
if ((ds.Tables["EXPORT_NOTES_HEAD"] != null)) {
base.Tables.Add(new EXPORT_NOTES_HEADDataTable(ds.Tables["EXPORT_NOTES_HEAD"]));
}
if ((ds.Tables["SHIPPING_INSTR_HEAD"] != null)) {
base.Tables.Add(new SHIPPING_INSTR_HEADDataTable(ds.Tables["SHIPPING_INSTR_HEAD"]));
}
if ((ds.Tables["PICKING_INSTR_HEAD"] != null)) {
base.Tables.Add(new PICKING_INSTR_HEADDataTable(ds.Tables["PICKING_INSTR_HEAD"]));
}
if ((ds.Tables["DELIVERY_INSTR_HEAD"] != null)) {
base.Tables.Add(new DELIVERY_INSTR_HEADDataTable(ds.Tables["DELIVERY_INSTR_HEAD"]));
}
if ((ds.Tables["SPECIAL_INSTR_HEAD"] != null)) {
base.Tables.Add(new SPECIAL_INSTR_HEADDataTable(ds.Tables["SPECIAL_INSTR_HEAD"]));
}
if ((ds.Tables["CUSTOMER_INSTR_HEAD"] != null)) {
base.Tables.Add(new CUSTOMER_INSTR_HEADDataTable(ds.Tables["CUSTOMER_INSTR_HEAD"]));
}
if ((ds.Tables["LABEL_INSTR_HEAD"] != null)) {
base.Tables.Add(new LABEL_INSTR_HEADDataTable(ds.Tables["LABEL_INSTR_HEAD"]));
}
if ((ds.Tables["CARRIER_INST_HEAD"] != null)) {
base.Tables.Add(new CARRIER_INST_HEADDataTable(ds.Tables["CARRIER_INST_HEAD"]));
}
if ((ds.Tables["INVOICE_UDF_HEAD"] != null)) {
base.Tables.Add(new INVOICE_UDF_HEADDataTable(ds.Tables["INVOICE_UDF_HEAD"]));
}
if ((ds.Tables["UDF_HEAD"] != null)) {
base.Tables.Add(new UDF_HEADDataTable(ds.Tables["UDF_HEAD"]));
}
if ((ds.Tables["UDF_HEADER"] != null)) {
base.Tables.Add(new UDF_HEADERDataTable(ds.Tables["UDF_HEADER"]));
}
if ((ds.Tables["HANDLING_INSTR_HEAD"] != null)) {
base.Tables.Add(new HANDLING_INSTR_HEADDataTable(ds.Tables["HANDLING_INSTR_HEAD"]));
}
if ((ds.Tables["PACK_ID_LINE_ITEM"] != null)) {
base.Tables.Add(new PACK_ID_LINE_ITEMDataTable(ds.Tables["PACK_ID_LINE_ITEM"]));
}
if ((ds.Tables["EXPORT_NOTES_DETAIL"] != null)) {
base.Tables.Add(new EXPORT_NOTES_DETAILDataTable(ds.Tables["EXPORT_NOTES_DETAIL"]));
}
if ((ds.Tables["SHIPPING_INSTR_DETAIL"] != null)) {
base.Tables.Add(new SHIPPING_INSTR_DETAILDataTable(ds.Tables["SHIPPING_INSTR_DETAIL"]));
}
if ((ds.Tables["PICKING_INSTR_DETAIL"] != null)) {
base.Tables.Add(new PICKING_INSTR_DETAILDataTable(ds.Tables["PICKING_INSTR_DETAIL"]));
}
if ((ds.Tables["DELIVERY_INSTR_DETAIL"] != null)) {
base.Tables.Add(new DELIVERY_INSTR_DETAILDataTable(ds.Tables["DELIVERY_INSTR_DETAIL"]));
}
if ((ds.Tables["SPECIAL_INSTR_DETAIL"] != null)) {
base.Tables.Add(new SPECIAL_INSTR_DETAILDataTable(ds.Tables["SPECIAL_INSTR_DETAIL"]));
}
if ((ds.Tables["CUSTOMER_INSTR_DETAIL"] != null)) {
base.Tables.Add(new CUSTOMER_INSTR_DETAILDataTable(ds.Tables["CUSTOMER_INSTR_DETAIL"]));
}
if ((ds.Tables["HANDLING_INSTR_DETAIL"] != null)) {
base.Tables.Add(new HANDLING_INSTR_DETAILDataTable(ds.Tables["HANDLING_INSTR_DETAIL"]));
}
if ((ds.Tables["UID_INSTR_DETAIL"] != null)) {
base.Tables.Add(new UID_INSTR_DETAILDataTable(ds.Tables["UID_INSTR_DETAIL"]));
}
if ((ds.Tables["CONFIG_INSTR_DETAIL"] != null)) {
base.Tables.Add(new CONFIG_INSTR_DETAILDataTable(ds.Tables["CONFIG_INSTR_DETAIL"]));
}
if ((ds.Tables["MAXKIT_DETAIL"] != null)) {
base.Tables.Add(new MAXKIT_DETAILDataTable(ds.Tables["MAXKIT_DETAIL"]));
}
if ((ds.Tables["UDF_DET"] != null)) {
base.Tables.Add(new UDF_DETDataTable(ds.Tables["UDF_DET"]));
}
if ((ds.Tables["UDF_DETAIL"] != null)) {
base.Tables.Add(new UDF_DETAILDataTable(ds.Tables["UDF_DETAIL"]));
}
if ((ds.Tables["HP_PN_COMPONENTS"] != null)) {
base.Tables.Add(new HP_PN_COMPONENTSDataTable(ds.Tables["HP_PN_COMPONENTS"]));
}
if ((ds.Tables["BOX"] != null)) {
base.Tables.Add(new BOXDataTable(ds.Tables["BOX"]));
}
if ((ds.Tables["SERIAL_NUM"] != null)) {
base.Tables.Add(new SERIAL_NUMDataTable(ds.Tables["SERIAL_NUM"]));
}
//.........这里部分代码省略.........
示例12: ReadXmlSchema
internal void ReadXmlSchema(XmlReader reader, bool denyResolving)
{
IntPtr ptr;
Bid.ScopeEnter(out ptr, "<ds.DataTable.ReadXmlSchema|INFO> %d#, denyResolving=%d{bool}\n", this.ObjectID, denyResolving);
try
{
System.Data.DataSet set = new System.Data.DataSet();
SerializationFormat remotingFormat = this.RemotingFormat;
set.ReadXmlSchema(reader, denyResolving);
string mainTableName = set.MainTableName;
if (!ADP.IsEmpty(this.tableName) || !ADP.IsEmpty(mainTableName))
{
DataTable currentTable = null;
if (!ADP.IsEmpty(this.tableName))
{
if (!ADP.IsEmpty(this.Namespace))
{
currentTable = set.Tables[this.tableName, this.Namespace];
}
else
{
int num3 = set.Tables.InternalIndexOf(this.tableName);
if (num3 > -1)
{
currentTable = set.Tables[num3];
}
}
}
else
{
string str3 = "";
int index = mainTableName.IndexOf(':');
if (index > -1)
{
str3 = mainTableName.Substring(0, index);
}
string str4 = mainTableName.Substring(index + 1, (mainTableName.Length - index) - 1);
currentTable = set.Tables[str4, str3];
}
if (currentTable == null)
{
string tableName = string.Empty;
if (!ADP.IsEmpty(this.tableName))
{
tableName = (this.Namespace.Length > 0) ? (this.Namespace + ":" + this.tableName) : this.tableName;
}
else
{
tableName = mainTableName;
}
throw ExceptionBuilder.TableNotFound(tableName);
}
currentTable._remotingFormat = remotingFormat;
List<DataTable> tableList = new List<DataTable> {
currentTable
};
this.CreateTableList(currentTable, tableList);
List<DataRelation> relationList = new List<DataRelation>();
this.CreateRelationList(tableList, relationList);
if (relationList.Count == 0)
{
if (this.Columns.Count == 0)
{
DataTable table5 = currentTable;
if (table5 != null)
{
table5.CloneTo(this, null, false);
}
if ((this.DataSet == null) && (this.tableNamespace == null))
{
this.tableNamespace = table5.Namespace;
}
}
}
else
{
if (ADP.IsEmpty(this.TableName))
{
this.TableName = currentTable.TableName;
if (!ADP.IsEmpty(currentTable.Namespace))
{
this.Namespace = currentTable.Namespace;
}
}
if (this.DataSet == null)
{
System.Data.DataSet set2 = new System.Data.DataSet(set.DataSetName);
set2.SetLocaleValue(set.Locale, set.ShouldSerializeLocale());
set2.CaseSensitive = set.CaseSensitive;
set2.Namespace = set.Namespace;
set2.mainTableName = set.mainTableName;
set2.RemotingFormat = set.RemotingFormat;
set2.Tables.Add(this);
}
this.CloneHierarchy(currentTable, this.DataSet, null);
foreach (DataTable table2 in tableList)
{
DataTable table4 = this.DataSet.Tables[table2.tableName, table2.Namespace];
DataTable table6 = set.Tables[table2.tableName, table2.Namespace];
foreach (Constraint constraint3 in table6.Constraints)
//.........这里部分代码省略.........
示例13: DeserializeDataTable
internal void DeserializeDataTable(SerializationInfo info, StreamingContext context, bool isSingleTable, SerializationFormat remotingFormat)
{
if (remotingFormat != SerializationFormat.Xml)
{
this.DeserializeTableSchema(info, context, isSingleTable);
if (isSingleTable)
{
this.DeserializeTableData(info, context, 0);
this.ResetIndexes();
}
}
else
{
string s = (string) info.GetValue("XmlSchema", typeof(string));
string str = (string) info.GetValue("XmlDiffGram", typeof(string));
if (s != null)
{
System.Data.DataSet set = new System.Data.DataSet();
set.ReadXmlSchema(new XmlTextReader(new StringReader(s)));
DataTable table = set.Tables[0];
table.CloneTo(this, null, false);
this.Namespace = table.Namespace;
if (str != null)
{
set.Tables.Remove(set.Tables[0]);
set.Tables.Add(this);
set.ReadXml(new XmlTextReader(new StringReader(str)), XmlReadMode.DiffGram);
set.Tables.Remove(this);
}
}
}
}
示例14: logplotDataSet1
protected logplotDataSet1(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) :
base(info, context, false) {
if ((this.IsBinarySerialized(info, context) == true)) {
this.InitVars(false);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler1 = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
this.Tables.CollectionChanged += schemaChangedHandler1;
this.Relations.CollectionChanged += schemaChangedHandler1;
return;
}
string strSchema = ((string)(info.GetValue("XmlSchema", typeof(string))));
if ((this.DetermineSchemaSerializationMode(info, context) == System.Data.SchemaSerializationMode.IncludeSchema)) {
System.Data.DataSet ds = new System.Data.DataSet();
ds.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
if ((ds.Tables["bitmap"] != null)) {
base.Tables.Add(new bitmapDataTable(ds.Tables["bitmap"]));
}
if ((ds.Tables["crossplot"] != null)) {
base.Tables.Add(new crossplotDataTable(ds.Tables["crossplot"]));
}
if ((ds.Tables["curve"] != null)) {
base.Tables.Add(new curveDataTable(ds.Tables["curve"]));
}
if ((ds.Tables["entity"] != null)) {
base.Tables.Add(new entityDataTable(ds.Tables["entity"]));
}
if ((ds.Tables["fill"] != null)) {
base.Tables.Add(new fillDataTable(ds.Tables["fill"]));
}
if ((ds.Tables["fossil"] != null)) {
base.Tables.Add(new fossilDataTable(ds.Tables["fossil"]));
}
if ((ds.Tables["histogram"] != null)) {
base.Tables.Add(new histogramDataTable(ds.Tables["histogram"]));
}
if ((ds.Tables["horizontal"] != null)) {
base.Tables.Add(new horizontalDataTable(ds.Tables["horizontal"]));
}
if ((ds.Tables["lithology"] != null)) {
base.Tables.Add(new lithologyDataTable(ds.Tables["lithology"]));
}
if ((ds.Tables["message"] != null)) {
base.Tables.Add(new messageDataTable(ds.Tables["message"]));
}
if ((ds.Tables["percent"] != null)) {
base.Tables.Add(new percentDataTable(ds.Tables["percent"]));
}
if ((ds.Tables["resource"] != null)) {
base.Tables.Add(new resourceDataTable(ds.Tables["resource"]));
}
if ((ds.Tables["sample"] != null)) {
base.Tables.Add(new sampleDataTable(ds.Tables["sample"]));
}
if ((ds.Tables["symbol"] != null)) {
base.Tables.Add(new symbolDataTable(ds.Tables["symbol"]));
}
if ((ds.Tables["text"] != null)) {
base.Tables.Add(new textDataTable(ds.Tables["text"]));
}
if ((ds.Tables["well"] != null)) {
base.Tables.Add(new wellDataTable(ds.Tables["well"]));
}
if ((ds.Tables["tadpole"] != null)) {
base.Tables.Add(new tadpoleDataTable(ds.Tables["tadpole"]));
}
if ((ds.Tables["sea"] != null)) {
base.Tables.Add(new seaDataTable(ds.Tables["sea"]));
}
if ((ds.Tables["configuration"] != null)) {
base.Tables.Add(new configurationDataTable(ds.Tables["configuration"]));
}
this.DataSetName = ds.DataSetName;
this.Prefix = ds.Prefix;
this.Namespace = ds.Namespace;
this.Locale = ds.Locale;
this.CaseSensitive = ds.CaseSensitive;
this.EnforceConstraints = ds.EnforceConstraints;
this.Merge(ds, false, System.Data.MissingSchemaAction.Add);
this.InitVars();
}
else {
this.ReadXmlSchema(new System.Xml.XmlTextReader(new System.IO.StringReader(strSchema)));
}
this.GetSerializationData(info, context);
System.ComponentModel.CollectionChangeEventHandler schemaChangedHandler = new System.ComponentModel.CollectionChangeEventHandler(this.SchemaChanged);
base.Tables.CollectionChanged += schemaChangedHandler;
this.Relations.CollectionChanged += schemaChangedHandler;
}