public void InsertRow(string freshbooksConnectionString)
{
// If the connection string is empty, use default.
if(freshbooksConnectionString == "")
{
freshbooksConnectionString =
"API Version=Alpha;Access Token=3d3355b2beea67f9241400fbe28f0b116e3efd2f8a85dda3c35620acdc95cd60;Refresh Token=75836f50da63fc5bf81bb24598511ae131ea422e73d9f321b4c4a44e2dd1c67f;Company Name=Devart";
}
FreshBooksConnection myConn = new FreshBooksConnection(freshbooksConnectionString);
string myInsertQuery = "INSERT INTO Client (Email, FirstName, LastName) VALUES ('[email protected]', 'John', 'Smith')";
FreshBooksCommand freshbooksCommand = new FreshBooksCommand(myInsertQuery);
freshbooksCommand.Connection = myConn;
myConn.Open();
try
{
freshbooksCommand.ExecuteNonQuery();
}
finally
{
myConn.Close();
}
}