Hello,
I'm having an issue with computed columns, it is throwing the following error:
An exception was caught during the execution of an action query: INSERT failed because the following SET options have incorrect settings: 'ARITHABORT'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or query notifications and/or xml data type methods.. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.
The exception is being thrown in this portion of the code:
Protected Overrides Overloads Function InsertEntity() As Boolean
Dim dao As SMSClientDAO = CType(CreateDAOInstance(), SMSClientDAO)
Return dao.AddNew(MyBase.Fields, MyBase.Transaction)
End Function
I tried using the SetArithAbortFlag, but it does not seem to work.
Here is the query generated by LLBLGen:
Query: SET ARITHABORT ON;INSERT INTO [MyDB].[sms].[SMSClient] ([CountryCode], [AreaCode], [PhoneNo], [ShortCode], [Keyword], [CampaignID]) VALUES (@CountryCode, @AreaCode, @PhoneNo, @ShortCode, @Keyword, @CampaignID);SELECT @SMSClientID=SCOPE_IDENTITY();SET ARITHABORT OFF
Parameter: @SMSClientID : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Output. Value: <undefined value>.
Parameter: @CountryCode : AnsiString. Length: 10. Precision: 0. Scale: 0. Direction: Input. Value: "1".
Parameter: @AreaCode : AnsiString. Length: 10. Precision: 0. Scale: 0. Direction: Input. Value: "555".
Parameter: @PhoneNo : AnsiString. Length: 25. Precision: 0. Scale: 0. Direction: Input. Value: "5551234".
Parameter: @ShortCode : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: 12345.
Parameter: @Keyword : AnsiString. Length: 50. Precision: 0. Scale: 0. Direction: Input. Value: "".
Parameter: @CampaignID : Int32. Length: 0. Precision: 10. Scale: 0. Direction: Input. Value: <undefined value>.
Here is the code that is failing (the .Save() line):
Dim SMSClient As New SMSClientEntity
With SMSClient
.CountryCode = PhoneNumber.CountryCode
.AreaCode = PhoneNumber.AreaCode
.PhoneNo = PhoneNumber.Number
.ShortCode = ShortCode
.Keyword = Keyword
.CampaignID = CampaignID
'SET ARITHABORT ON
DbUtils.SetArithAbortFlag(True)
.Save()
.Refetch()
End With
Any ideas what I can do?