System.Data.Common.DataColumnMappingCollection.Add(string, string)

Here are the examples of the csharp api class System.Data.Common.DataColumnMappingCollection.Add(string, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

31 Examples 7

1. Example

View license
IColumnMapping IColumnMappingCollection.Add(string sourceColumnName, string dataSetColumnName) {
            return Add(sourceColumnName, dataSetColumnName);
        }

2. Example

Project: referencesource
Source File: DataTableMapping.cs
View license
object ICloneable.Clone() {
            DataTableMapping clone = new DataTableMapping(); // MDAC 81448
            clone._dataSetTableName = _dataSetTableName;
            clone._sourceTableName = _sourceTableName;

            if ((null != _columnMappings) && (0 < ColumnMappings.Count)) {
                DataColumnMappingCollection parameters = clone.ColumnMappings;
                foreach(ICloneable parameter in ColumnMappings) {
                    parameters.Add(parameter.Clone());
                }
            }
            return clone;
        }

3. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
        private void InitAdapter() {
            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "IndexInfo";
            tableMapping.ColumnMappings.Add("IndexName", "IndexName");
            tableMapping.ColumnMappings.Add("TableName", "TableName");
            this._adapter.TableMappings.Add(tableMapping);
        }

4. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
        private void InitAdapter() {
            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "SummaryBlock";
            tableMapping.ColumnMappings.Add("BlockId", "BlockId");
            tableMapping.ColumnMappings.Add("BlockHash", "BlockHash");
            tableMapping.ColumnMappings.Add("PreviousBlockHash", "PreviousBlockHash");
            this._adapter.TableMappings.Add(tableMapping);
        }

5. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
        private void InitAdapter() {
            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "ValidationBlockchain";
            tableMapping.ColumnMappings.Add("BlockCount", "BlockCount");
            tableMapping.ColumnMappings.Add("TransactionCount", "TransactionCount");
            tableMapping.ColumnMappings.Add("TransactionInputCount", "TransactionInputCount");
            tableMapping.ColumnMappings.Add("TotalInputBtc", "TotalInputBtc");
            tableMapping.ColumnMappings.Add("TransactionOutputCount", "TransactionOutputCount");
            tableMapping.ColumnMappings.Add("TotalOutputBtc", "TotalOutputBtc");
            tableMapping.ColumnMappings.Add("TransactionFeeBtc", "TransactionFeeBtc");
            tableMapping.ColumnMappings.Add("TotalUnspentOutputBtc", "TotalUnspentOutputBtc");
            this._adapter.TableMappings.Add(tableMapping);
        }

6. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
        private void InitAdapter() {
            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "ValidationBlockchainFiles";
            tableMapping.ColumnMappings.Add("BlockchainFileId", "BlockchainFileId");
            tableMapping.ColumnMappings.Add("BlockchainFileName", "BlockchainFileName");
            tableMapping.ColumnMappings.Add("BlockCount", "BlockCount");
            tableMapping.ColumnMappings.Add("TransactionCount", "TransactionCount");
            tableMapping.ColumnMappings.Add("TransactionInputCount", "TransactionInputCount");
            tableMapping.ColumnMappings.Add("TotalInputBtc", "TotalInputBtc");
            tableMapping.ColumnMappings.Add("TransactionOutputCount", "TransactionOutputCount");
            tableMapping.ColumnMappings.Add("TotalOutputBtc", "TotalOutputBtc");
            tableMapping.ColumnMappings.Add("TransactionFeeBtc", "TransactionFeeBtc");
            tableMapping.ColumnMappings.Add("TotalUnspentOutputBtc", "TotalUnspentOutputBtc");
            this._adapter.TableMappings.Add(tableMapping);
        }

7. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
        private void InitAdapter() {
            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "ValidationTransactionInput";
            tableMapping.ColumnMappings.Add("TransactionInputId", "TransactionInputId");
            tableMapping.ColumnMappings.Add("BitcoinTransactionId", "BitcoinTransactionId");
            tableMapping.ColumnMappings.Add("SourceTransactionOutputId", "SourceTransactionOutputId");
            tableMapping.ColumnMappings.Add("TransactionInputValueBtc", "TransactionInputValueBtc");
            tableMapping.ColumnMappings.Add("SourceTransactionHash", "SourceTransactionHash");
            tableMapping.ColumnMappings.Add("SourceTransactionOutputIndex", "SourceTransactionOutputIndex");
            this._adapter.TableMappings.Add(tableMapping);
        }

8. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Data.Design.TypedDataSetGenerator", "4.0.0.0")]
        private void InitAdapter() {
            this._adapter = new global::System.Data.SqlClient.SqlDataAdapter();
            global::System.Data.Common.DataTableMapping tableMapping = new global::System.Data.Common.DataTableMapping();
            tableMapping.SourceTable = "Table";
            tableMapping.DataSetTable = "ValidationTransactionOutput";
            tableMapping.ColumnMappings.Add("TransactionOutputId", "TransactionOutputId");
            tableMapping.ColumnMappings.Add("BitcoinTransactionId", "BitcoinTransactionId");
            tableMapping.ColumnMappings.Add("OutputIndex", "OutputIndex");
            tableMapping.ColumnMappings.Add("OutputValueBtc", "OutputValueBtc");
            tableMapping.ColumnMappings.Add("OutputScript", "OutputScript");
            tableMapping.ColumnMappings.Add("IsSpent", "IsSpent");
            this._adapter.TableMappings.Add(tableMapping);
        }

9. Example

View license
[Test]
        public void DataSetFillNoParams()
        {
            String sql = "select USER_ID, USER_NAME from USER_TABLE";
            DataSet dataSet = new DataSet();
            adoOperations.DataSetFill(dataSet, CommandType.Text, sql);
            Assert.AreEqual(1, dataSet.Tables.Count);
            Assert.AreEqual(18, dataSet.Tables["Table"].Rows.Count);

            dataSet = new DataSet();
            adoOperations.DataSetFill(dataSet, CommandType.Text, sql, new string[] {"TestObjects"});
            Assert.AreEqual(1, dataSet.Tables.Count);
            Assert.AreEqual(18, dataSet.Tables["TestObjects"].Rows.Count);

            dataSet = new DataSet();
            DataTableMappingCollection mappingCollection =
                new DataTableMappingCollection();
            DataTableMapping testObjectsMapping = mappingCollection.Add("Table", "TestObjects");
            testObjectsMapping.ColumnMappings.Add("USER_ID", "UserID");
            testObjectsMapping.ColumnMappings.Add("USER_NAME", "UserName");
            adoOperations.DataSetFill(dataSet, CommandType.Text, sql, mappingCollection);
            Assert.AreEqual(1, dataSet.Tables.Count);
            Assert.AreEqual(18, dataSet.Tables["TestObjects"].Rows.Count);
            foreach (DataRow testObjectRow in dataSet.Tables["TestObjects"].Rows)
            {
                Assert.IsNotNull(testObjectRow["UserID"]);
                Assert.IsNotNull(testObjectRow["UserName"]);
            }
        }

10. Example

Project: spring-net
Source File: AdoTemplateTests.cs
View license
[Test]
	    public void FillDataSetNoParams()
	    {
	        PopulateTestObjectsTable();
	        string sql = ValidateTestObjects(4);
	        DataSet dataSet;

	        dataSet = new DataSet();
	        adoOperations.DataSetFill(dataSet, CommandType.Text, sql, new string[] {"TestObjects"});
            Assert.AreEqual(1, dataSet.Tables.Count);
            Assert.AreEqual(4, dataSet.Tables["TestObjects"].Rows.Count);
	        
	        dataSet = new DataSet();
	        DataTableMappingCollection mappingCollection = 
	            new DataTableMappingCollection();
	        DataTableMapping testObjectsMapping = mappingCollection.Add("Table", "TestObjects");
	        testObjectsMapping.ColumnMappings.Add("TestObjectNo", "UserID");
	        testObjectsMapping.ColumnMappings.Add("Name", "UserName");
            adoOperations.DataSetFill(dataSet, CommandType.Text, sql, mappingCollection);
            Assert.AreEqual(1, dataSet.Tables.Count);
            Assert.AreEqual(4, dataSet.Tables["TestObjects"].Rows.Count);	        
	        foreach (DataRow testObjectRow in dataSet.Tables["TestObjects"].Rows)
	        {
	            Assert.IsNotNull(testObjectRow["UserID"]);
	            Assert.IsNotNull(testObjectRow["Age"]);
	            Assert.IsNotNull(testObjectRow["UserName"]);
	        }
	        
	    }

11. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

12. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

13. Example

Project: openpetra
Source File: Access.cs
View license
public int SelectUsingDataAdapterMulti(String ASqlStatement, TDBTransaction AReadTransaction, ref Da/n ..... /n //View Source file for more details /n }

14. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

15. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

16. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

17. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

18. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

19. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

20. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

21. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

22. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

23. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

24. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

25. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

26. Example

Project: surveyproject
Source File: Test.Designer.cs
View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

27. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

28. Example

Project: IKendeLib
Source File: DataSet1.Designer.cs
View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

29. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

30. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }

31. Example

View license
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
        [global::System.CodeDom.Compiler/n ..... /n //View Source file for more details /n }