I'm trying to insert a new donation via iBO in .net and the save function is throwing a "Connection string could not be initialized" error.
Sounds like a strait forward problem but here is the odd thing... From everything i can see, the record is getting inserted just fine! The batch, activities, trans records, it all looks exactly the same as a record that is entered though the regular iMIS user interface.
Has anyone else experienced this, or have any thoughts??
Code :
Asi.iBO.Financials.CBatch o_Batch = new Asi.iBO.Financials.CBatch(o_IboCommon.GetStaffUser());
o_Batch.BatchNumber = DateTime.Now.ToString("WD_yyMMddHHmmss");
o_Batch.Description = "Web Based Donation";
o_Batch.CashEntity = "FOUND";
o_Batch.CashGLAccount = GLAccount;
o_Batch.CashAccountCode = CashAccountCode;
o_Batch.Save();
CGift o_Gift = new CGift(o_IboCommon.GetStaffUser());
o_Gift.BatchNumber = o_Batch.BatchNumber;
o_Gift.Amount = Amount;
o_Gift.PaymentAmount = Amount;
o_Gift.PaymentType = Asi.iBO.Financials.EnumPaymentType.CreditCard;
o_Gift.Description = "Gift";
o_Gift.Note = "Notes and more Notes";
o_Gift.ListAs = "list as here ";
o_Gift.UserField2 = "Ufeild 2";
o_Gift.UserField3 = "Ufeild 3";
o_Gift.Payment.CreditCardNumber = CreditCardNumber;
o_Gift.Payment.CreditCardExpiration = CreditCardExpiration.ToString("MMyy");
o_Gift.Payment.CreditCardSecurityCode = CreditCardSecurityCode;
o_Gift.Payment.CreditDebitCardHoldersName = CreditCardHoldersName;
o_Gift.CashAccountCode = CashAccountCode;
o_Gift.DonorContactId = DonorContactId;
o_Gift.DistributionCode = "GENFM";
o_Gift.Validate();
o_Gift.Save(); //ERRORS OUT ON SAVE
"ConnectionString property
"ConnectionString property could not be...." error is a .net error not an iBO business logic error.
Could you paste in the entire stack trace of the exception please?
If this is a standalone web application and doesn't sit in the iMIS framework, do you call iboAdmin.InitializeSystem when your application starts?
iBO does not throw exceptions unless you specify it in the user object being returned by GetStaffUser.
Looking at your code, it doesn't look like you are checking the errors collection in any of the objects,
which would indicate you have switched on throwexceptiononerrors property.
If you haven't switched it on, then try checking errors collection every time you call validate or save on any ibo objects.
Nasser
Avion Software
www.avion-software.com