omicrondemo
11-03-2007, 12:50 AM
Hi,
This should be straight forward, but I've searched high and low on the net.
I have a FORM which allows me to INSERT data, SQL Server 2005 backend. I populate the all the mandatory fields.
But when I click on the Insert button, it won't let me save and says:
Column 'PERSONAL_ID' does not allow nulls
I'm using tableadapters, business logic layers etc. and pausing clearly shows that the values from the form are being passed to the procedure that I have created 'AddNewRecord'. And PERSONAL_ID is definitely not NULL!
It fails on
Line 971: Me.Rows.Add(row)
PERSONAL_ID is a primary key which I generate. The pause also shows that for PERSONAL_ID it says ' {'Conversion from type 'DBNull' to type 'String' is not valid.'}
Function AddNewRecord looks like this:
<System.ComponentModel.DataObjectMethodAttribute(Sy stem.ComponentModel.DataObjectMethodType.Insert, True)> _
Public Function AddNewRecord(ByVal PERSONAL_ID As String, ByVal SURNAME As String, ByVal CHRISTIAN_NAME As String, ByVal SEX As String, _
ByVal FAMILY_POSITION As String, ByVal FAMILY_ID As String, ByVal ADDRESS_1 As String, ByVal ADDRESS_2 As String, _
ByVal ADDRESS_3 As String, ByVal ADDRESS_4 As String, ByVal ADDRESS_5 As String, ByVal ADDRESS_6 As String, ByVal POSTCODE As String, ByVal COUNTRY As String, ByVal ORG_ID As String) As Boolean
' create a new details row instance
Dim details As New smDetails.smTbl_DetailsIDDataTable
Dim detail As smDetails.smTbl_DetailsIDRow = details.NewsmTbl_DetailsIDRow
details.AddsmTbl_DetailsIDRow(detail)
.
.
.
Any pointers in the right direction would be appreciated. I'm not sure if using .NET 3.5 is a factor.
Thanks in advance
Tushar
This should be straight forward, but I've searched high and low on the net.
I have a FORM which allows me to INSERT data, SQL Server 2005 backend. I populate the all the mandatory fields.
But when I click on the Insert button, it won't let me save and says:
Column 'PERSONAL_ID' does not allow nulls
I'm using tableadapters, business logic layers etc. and pausing clearly shows that the values from the form are being passed to the procedure that I have created 'AddNewRecord'. And PERSONAL_ID is definitely not NULL!
It fails on
Line 971: Me.Rows.Add(row)
PERSONAL_ID is a primary key which I generate. The pause also shows that for PERSONAL_ID it says ' {'Conversion from type 'DBNull' to type 'String' is not valid.'}
Function AddNewRecord looks like this:
<System.ComponentModel.DataObjectMethodAttribute(Sy stem.ComponentModel.DataObjectMethodType.Insert, True)> _
Public Function AddNewRecord(ByVal PERSONAL_ID As String, ByVal SURNAME As String, ByVal CHRISTIAN_NAME As String, ByVal SEX As String, _
ByVal FAMILY_POSITION As String, ByVal FAMILY_ID As String, ByVal ADDRESS_1 As String, ByVal ADDRESS_2 As String, _
ByVal ADDRESS_3 As String, ByVal ADDRESS_4 As String, ByVal ADDRESS_5 As String, ByVal ADDRESS_6 As String, ByVal POSTCODE As String, ByVal COUNTRY As String, ByVal ORG_ID As String) As Boolean
' create a new details row instance
Dim details As New smDetails.smTbl_DetailsIDDataTable
Dim detail As smDetails.smTbl_DetailsIDRow = details.NewsmTbl_DetailsIDRow
details.AddsmTbl_DetailsIDRow(detail)
.
.
.
Any pointers in the right direction would be appreciated. I'm not sure if using .NET 3.5 is a factor.
Thanks in advance
Tushar