CreateCommand Method (FreshBooksConnection)
Creates and returns a
FreshBooksCommand object associated with the
FreshBooksConnection.
In this sample
FreshBooksCommand object is created. It is automatically associated with
FreshBooksConnection that created it.
|
|---|
public void CreateFreshBooksCommand(string myConnString)
{
FreshBooksConnection freshBooksConnection = new FreshBooksConnection(myConnString);
FreshBooksCommand freshBooksCommand = freshBooksConnection.CreateCommand();
freshBooksCommand.CommandText = "INSERT INTO Client (Email, FirstName, LastName) VALUES ('[email protected]', 'John', 'Smith')";
freshBooksConnection.Open();
try
{
freshBooksCommand.ExecuteNonQuery();
}
finally
{
freshBooksConnection.Close();
}
} |
|
|---|
Public Sub CreateFreshBooksCommand(ByVal myConnString As String)
Dim freshBooksConnection As New FreshBooksConnection(myConnString)
Dim freshBooksCommand As FreshBooksCommand = freshBooksConnection.CreateCommand()
freshBooksCommand.CommandText = "INSERT INTO Client (Email, FirstName, LastName) VALUES ('[email protected]', 'John', 'Smith')"
freshBooksConnection.Open()
Try
freshBooksCommand.ExecuteNonQuery()
Finally
freshBooksConnection.Close()
End Try
End Sub |