Condividi tramite


Costruttore SqlCeCommand

Inizializza una nuova istanza della classe SqlCeCommand.

Spazio dei nomi  System.Data.SqlServerCe
Assembly:  System.Data.SqlServerCe (in System.Data.SqlServerCe.dll)

Sintassi

'Dichiarazione
<SecurityCriticalAttribute> _
<SecurityTreatAsSafeAttribute> _
Public Sub New
'Utilizzo

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

Osservazioni

Il costruttore base consente di inizializzare tutti i campi impostandoli sui relativi valori predefiniti. Nella tabella seguente sono riportati i valori iniziali della proprietà per un'istanza dell'oggetto SqlCeCommand.

Proprietà

Valore iniziale

CommandText

stringa vuota ("")

CommandType

Text

Connection

null

Esempi

Nell'esempio seguente viene creato un oggetto SqlCeCommand e ne vengono impostate alcune proprietà.

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;

Vedere anche

Riferimento

SqlCeCommand Classe

Overload SqlCeCommand

Spazio dei nomi System.Data.SqlServerCe