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 ('smithj@test1.com', '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 ('smithj@test1.com', 'John', 'Smith')"
freshbooksConnection.Open()
Try
freshbooksCommand.ExecuteNonQuery()
Finally
freshbooksConnection.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