# Class NpgsqlCopyTextWriter

Namespace
  Npgsql

Assembly
  Npgsql.dll

Writer for a text import, initiated by BeginTextImport(string).

    public sealed class NpgsqlCopyTextWriter : StreamWriter, IDisposable, IAsyncDisposable

Inheritance
  object
  MarshalByRefObject
  TextWriter
  StreamWriter
  NpgsqlCopyTextWriter

Implements
  IDisposable
  IAsyncDisposable

Inherited Members
  StreamWriter.Null
  StreamWriter.Close()
  StreamWriter.DisposeAsync()
  StreamWriter.Flush()
  StreamWriter.FlushAsync()
  StreamWriter.FlushAsync(CancellationToken)
  StreamWriter.Write(char)
  StreamWriter.Write(char[])
  StreamWriter.Write(char[], int, int)
  StreamWriter.Write(ReadOnlySpan<char>)
  StreamWriter.Write(string)
  StreamWriter.Write(string, object)
  StreamWriter.Write(string, object, object)
  StreamWriter.Write(string, object, object, object)
  StreamWriter.Write(string, params object[])
  StreamWriter.Write(string, params ReadOnlySpan<object>)
  StreamWriter.WriteAsync(char)
  StreamWriter.WriteAsync(char[], int, int)
  StreamWriter.WriteAsync(ReadOnlyMemory<char>, CancellationToken)
  StreamWriter.WriteAsync(string)
  StreamWriter.WriteLine(ReadOnlySpan<char>)
  StreamWriter.WriteLine(string)
  StreamWriter.WriteLine(string, object)
  StreamWriter.WriteLine(string, object, object)
  StreamWriter.WriteLine(string, object, object, object)
  StreamWriter.WriteLine(string, params object[])
  StreamWriter.WriteLine(string, params ReadOnlySpan<object>)
  StreamWriter.WriteLineAsync()
  StreamWriter.WriteLineAsync(char)
  StreamWriter.WriteLineAsync(char[], int, int)
  StreamWriter.WriteLineAsync(ReadOnlyMemory<char>, CancellationToken)
  StreamWriter.WriteLineAsync(string)
  StreamWriter.AutoFlush
  StreamWriter.BaseStream
  StreamWriter.Encoding
  TextWriter.CreateBroadcasting(params TextWriter[])
  TextWriter.Dispose()
  TextWriter.Synchronized(TextWriter)
  TextWriter.Write(bool)
  TextWriter.Write(decimal)
  TextWriter.Write(double)
  TextWriter.Write(int)
  TextWriter.Write(long)
  TextWriter.Write(object)
  TextWriter.Write(float)
  TextWriter.Write(StringBuilder)
  TextWriter.Write(uint)
  TextWriter.Write(ulong)
  TextWriter.WriteAsync(char[])
  TextWriter.WriteAsync(StringBuilder, CancellationToken)
  TextWriter.WriteLine()
  TextWriter.WriteLine(bool)
  TextWriter.WriteLine(char)
  TextWriter.WriteLine(char[])
  TextWriter.WriteLine(char[], int, int)
  TextWriter.WriteLine(decimal)
  TextWriter.WriteLine(double)
  TextWriter.WriteLine(int)
  TextWriter.WriteLine(long)
  TextWriter.WriteLine(object)
  TextWriter.WriteLine(float)
  TextWriter.WriteLine(StringBuilder)
  TextWriter.WriteLine(uint)
  TextWriter.WriteLine(ulong)
  TextWriter.WriteLineAsync(char[])
  TextWriter.WriteLineAsync(StringBuilder, CancellationToken)
  TextWriter.FormatProvider
  TextWriter.NewLine
  MarshalByRefObject.GetLifetimeService()
  MarshalByRefObject.InitializeLifetimeService()
  object.Equals(object)
  object.Equals(object, object)
  object.GetHashCode()
  object.GetType()
  object.ReferenceEquals(object, object)
  object.ToString()

## Remarks

See https://www.postgresql.org/docs/current/static/sql-copy.html.

## Properties

### Timeout

Gets or sets a value, in milliseconds, that determines how long the text writer will attempt to write before timing out.

    public int Timeout { get; set; }

#### Property Value

int

## Methods

### Cancel()

Cancels and terminates an ongoing import. Any data already written will be discarded.

    public void Cancel()

### CancelAsync()

Cancels and terminates an ongoing import. Any data already written will be discarded.

    public Task CancelAsync()

#### Returns

Task