Prepare() method

Prepares or compiles the SACommand on the data source.

Visual Basic syntax

Public Overrides Sub Prepare ()

C# syntax

public override void Prepare ()

Usage

If you call one of the ExecuteNonQuery, ExecuteReader, or ExecuteScalar methods after calling Prepare, any parameter value that is larger than the value specified by the Size property is automatically truncated to the original specified size of the parameter, and no truncation errors are returned.

The truncation only happens for the following data types:

  • CHAR
  • VARCHAR
  • LONG VARCHAR
  • TEXT
  • NCHAR
  • NVARCHAR
  • LONG NVARCHAR
  • NTEXT
  • BINARY
  • LONG BINARY
  • VARBINARY
  • IMAGE

If the size property is not specified, and so is using the default value, the data is not truncated.