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 |