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 sqLiteConnection = new SQLiteConnection(myConnString);
SQLiteCommand sqLiteCommand = sqLiteConnection.CreateCommand();
sqLiteCommand.CommandText = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')";
sqLiteConnection.Open();
try
{
sqLiteCommand.ExecuteNonQuery();
}
finally
{
sqLiteConnection.Close();
}
} |
|
|---|
Public Sub CreateSQLiteCommand(ByVal myConnString As String)
Dim sqLiteConnection As New SQLiteConnection(myConnString)
Dim sqLiteCommand As SQLiteCommand = sqLiteConnection.CreateCommand()
sqLiteCommand.CommandText = "INSERT INTO DEPT VALUES (50,'Development','Philadelphia')"
sqLiteConnection.Open()
Try
sqLiteCommand.ExecuteNonQuery()
Finally
sqLiteConnection.Close()
End Try
End Sub |