CreateCommand Method (SQLiteConnection)
Creates and returns a
SQLiteCommand object associated with the
SQLiteConnection.
In this sample
SQLiteCommand object is created. It is automatically associated with
SQLiteConnection that created it.
|
|---|
public void CreateSQLiteCommand(string myConnString)
{
SQLiteConnection sqConnection = new SQLiteConnection(myConnString);
SQLiteCommand sqCommand = sqConnection.CreateCommand();
sqCommand.CommandText = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')";
sqConnection.Open();
try
{
sqCommand.ExecuteNonQuery();
}
finally
{
sqConnection.Close();
}
} |
|
|---|
Public Sub CreateSQLiteCommand(ByVal myConnString As String)
Dim sqConnection As New SQLiteConnection(myConnString)
Dim sqCommand As SQLiteCommand = sqConnection.CreateCommand()
sqCommand.CommandText = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')"
sqConnection.Open()
Try
sqCommand.ExecuteNonQuery()
Finally
sqConnection.Close()
End Try
End Sub |