public void InsertRow(string sugarConnectionString)
{
// If the connection string is empty, use default.
if(sugarConnectionString == "")
{
sugarConnectionString =
"server=https://your_company.sugaropencloud.eu;user id=admin;password=AmFFA4ZryM;";
}
SugarConnection myConn = new SugarConnection(sugarConnectionString);
string myInsertQuery = "INSERT INTO Campaigns (name, campaign_type, end_date, status) VALUES ('Sale campaign', 'Email', '2016-12-12', 'Active')";
SugarCommand sugarCommand = new SugarCommand(myInsertQuery);
sugarCommand.Connection = myConn;
myConn.Open();
try
{
sugarCommand.ExecuteNonQuery();
}
finally
{
myConn.Close();
}
}