Hi,
This is my first time on the forum, but I've read a few of the threads.
As is the case with most large organisations I've been given a project with tight timescales to deliver as soon as possible using ASP .NET and utilising LLBGEN software to access an Oracle database, except for the Oracle database, I don't know any of the other software. I've been in the software development business for over 25 years, mainly 3gl type languages and I've been given no training or manuals and have been told to get on with it!! Situation normal.
I've managed to get going and have generated a number of web pages and the LLBGEN stuff works fine. except for the following problem.
I'm inserting a user details record into a table and some of the fields can be null. When I come to save() the record, it stores the record on the database correctly but also gives an error message. This error message is not there when all the fields are populated.
Error Message
'An exception was caught during the execution of an action query: Value cannot be null.
Parameter name: value. Check InnerException, QueryExecuted and Parameters of this exception to examine the cause of this exception.'
Only the USER_SURNAME is a NOT NULL field
If e.CommandName = "AddNewRow" Then
_Entity = New FGFM.EntityClasses.USR_DETAILSEntity
With (_Entity)
.USER_SURNAME = Convert.ToString(CType(e.Item.FindControl"txtSurnameF"),
TextBox).Text)
.USER_NAME = Convert.ToString(CType(e.Item.FindControl("txtNameF"), TextBox).Text)
ein = Convert.ToString(CType(e.Item.FindControl("txtEinF"), TextBox).Text)
If ein <> "" Then
.USER_EIN = Convert.ToDecimal(CType(e.Item.FindControl("txtEinF"), TextBox).Text)
End If
.USER_TEL = Convert.ToString(CType(e.Item.FindControl("txtUserTelF"), TextBox).Text)
.USER_TITLE = Convert.ToString(CType(e.Item.FindControl("txtTitleF"), TextBox).Text)
Try
.Save()
SetErrorMessage("")
Catch ex As Exception
'Set error message
SetErrorMessage(Convert.ToString(ex.Message))
transactionManager.Rollback()
Finally
' clean up. Necessary action.
transactionManager.Dispose()
End Try
end if
Hope you can make sense of the code.
Thanks
Mike
PS. I've put a bit of 3gl code to get around the problem of the EIN field which was giving me grief because it was trying to convert a null value in the text field to an integer. I'm sure that there is an elegant way of doing it, but I just don't have the time to find out how!!