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
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2