Beispiel #1
0
 private void UnregisterColumnName(SqlBulkCopyColumnOrderHint orderHint, string columnName)
 {
     if (Contains(orderHint))
     {
         _columnNames.Remove(columnName);
         orderHint.NameChanging -= ColumnNameChanging;
     }
 }
Beispiel #2
0
 /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopyColumnOrderHintCollection.xml' path='docs/members[@name="SqlBulkCopyColumnOrderHintCollection"]/Remove/*'/>
 public void Remove(SqlBulkCopyColumnOrderHint columnOrderHint)
 {
     if (columnOrderHint == null)
     {
         throw new ArgumentNullException(nameof(columnOrderHint));
     }
     // OnRemove only works with the List instance and not the InnerList instance
     List.Remove(columnOrderHint);
 }
Beispiel #3
0
 private void RegisterColumnName(SqlBulkCopyColumnOrderHint orderHint, string columnName)
 {
     if (_columnNames.Contains(columnName))
     {
         throw SQL.BulkLoadOrderHintDuplicateColumn(orderHint.Column);
     }
     _columnNames.Add(columnName);
     orderHint.NameChanging += ColumnNameChanging;
 }
Beispiel #4
0
 /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopyColumnOrderHintCollection.xml' path='docs/members[@name="SqlBulkCopyColumnOrderHintCollection"]/Insert/*'/>
 public void Insert(int index, SqlBulkCopyColumnOrderHint columnOrderHint)
 {
     // Try inserting into an invalid index to throw an exception
     if (index < 0 || index > InnerList.Count)
     {
         InnerList.Insert(index, columnOrderHint);
     }
     if (columnOrderHint == null)
     {
         throw new ArgumentNullException(nameof(columnOrderHint));
     }
     RegisterColumnName(columnOrderHint, columnOrderHint.Column);
     InnerList.Insert(index, columnOrderHint);
 }
Beispiel #5
0
 /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopyColumnOrderHintCollection.xml' path='docs/members[@name="SqlBulkCopyColumnOrderHintCollection"]/Add[@name="columnOrderHintParameter"]/*'/>
 public SqlBulkCopyColumnOrderHint Add(SqlBulkCopyColumnOrderHint columnOrderHint)
 {
     if (columnOrderHint == null)
     {
         throw new ArgumentNullException(nameof(columnOrderHint));
     }
     if (string.IsNullOrEmpty(columnOrderHint.Column) ||
         columnOrderHint.SortOrder == SortOrder.Unspecified)
     {
         throw SQL.BulkLoadInvalidOrderHint();
     }
     RegisterColumnName(columnOrderHint, columnOrderHint.Column);
     InnerList.Add(columnOrderHint);
     return(columnOrderHint);
 }
Beispiel #6
0
 /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopyColumnOrderHintCollection.xml' path='docs/members[@name="SqlBulkCopyColumnOrderHintCollection"]/IndexOf/*'/>
 public int IndexOf(SqlBulkCopyColumnOrderHint value) => InnerList.IndexOf(value);
Beispiel #7
0
 /// <include file='../../../../../../doc/snippets/Microsoft.Data.SqlClient/SqlBulkCopyColumnOrderHintCollection.xml' path='docs/members[@name="SqlBulkCopyColumnOrderHintCollection"]/Contains/*'/>
 public bool Contains(SqlBulkCopyColumnOrderHint value) => InnerList.Contains(value);