Compartilhar via


Construtor SqlCeCommand

Inicializa uma nova instância da classe SqlCeCommand.

Namespace:  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (em System.Data.SqlServerCe.dll)

Sintaxe

'Declaração
<SecurityCriticalAttribute> _
<SecurityTreatAsSafeAttribute> _
Public Sub New
'Uso

Dim instance As New SqlCeCommand()
[SecurityCriticalAttribute]
[SecurityTreatAsSafeAttribute]
public SqlCeCommand()
[SecurityCriticalAttribute]
[SecurityTreatAsSafeAttribute]
public:
SqlCeCommand()
[<SecurityCriticalAttribute>]
[<SecurityTreatAsSafeAttribute>]
new : unit -> SqlCeCommand
public function SqlCeCommand()

Comentários

O construtor base inicializa todos os campos com seus valores padrão. A tabela a seguir mostra os valores de propriedades iniciais para uma instância de SqlCeCommand.

Propriedades

Valor inicial

CommandText

cadeia de caracteres vazia ("")

CommandType

Text

Connection

null

Exemplos

O exemplo a seguir cria um SqlCeCommand e define algumas de suas propriedades.

Dim cmd As SqlCeCommand = conn.CreateCommand()
cmd.CommandText = "SELECT * FROM Categories ORDER BY CategoryID"
cmd.CommandType = CommandType.Text
cmd.UpdatedRowSource = UpdateRowSource.Both
SqlCeCommand cmd = conn.CreateCommand();
cmd.CommandText = "SELECT * FROM Categories ORDER BY CategoryID";
cmd.CommandType = CommandType.Text;
cmd.UpdatedRowSource = UpdateRowSource.Both;

Consulte também

Referência

SqlCeCommand Classe

Sobrecarregado SqlCeCommand

Namespace System.Data.SqlServerCe