OdbcCommand.Prepare 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.
Creates a prepared or compiled version of the command at the data source.
public:
override void Prepare();
public:
virtual void Prepare();
public override void Prepare ();
public void Prepare ();
override this.Prepare : unit -> unit
abstract member Prepare : unit -> unit
override this.Prepare : unit -> unit
Public Overrides Sub Prepare ()
Public Sub Prepare ()
Implements
Exceptions
Remarks
The Prepare method calls the ODBC SQLPrepare
function. Depending on the capabilities of the underlying ODBC driver and data source, parameter information such as data types may be checked when the statement is prepared, if all parameters have been bound, or when it is executed if not all parameters have been bound. For maximum interoperability, an application should unbind all parameters that applied to a previous SQL statement before preparing a new SQL statement on the same OdbcCommand. This prevents errors that are caused by previous parameter information being applied to the new SQL statement.
If you call an Execute method after you call 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.
Output parameters (whether prepared or not) must have a user-specified data type. If you specify a variable length data type, you must also specify the maximum Size.
Applies to
See also
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기