SqlBulkCopy.ClearCachedMetadata Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Clears the cached destination table metadata when using the CacheMetadata option.
public:
void ClearCachedMetadata();
public void ClearCachedMetadata();
member this.ClearCachedMetadata : unit -> unit
Public Sub ClearCachedMetadata ()
Remarks
Call this method when you know the destination table schema has changed and you want to force the next WriteToServer operation to refresh the metadata from the server.
The cache is automatically invalidated when the DestinationTableName property is changed to a different table name.
The cache is not automatically invalidated when the connection context changes. Call this method if the underlying SqlConnection changes database (for example, via ChangeDatabase(String)) or reconnects to a different server due to failover.