Use the Prepared property to have the provider save a prepared (or compiled) version of the query specified in the CommandText property before a Command object’s first execution. This may slow a command’s first execution,but once the provider compiles a command,the provider will use the compiled version of the command for any subsequent executions,which will result in improved performance.
If the property is False,the provider will execute the Command object directly without creating a compiled version.
If the provider does not support command preparation,it may return an error when this property is set to True. If the provider does not return an error,it simply ignores the request to prepare the command and sets the Prepared property to False.
这基本上表示编译了SQL语句(预解析并标记化和分析).当查询被多次使用时,每次只需替换参数值就可以使用这个编译版本,而不必重新编译所有语句并完成其他工作.