After posting this in the ASP.NET forum (thread855-941738) I realized that it would be better suited here since it is actually a VB.NET question.
I'm programming a sub that adds a new record to a database. On my form I have an "Add" button with the below click handler.
The process is pretty straight forward - I simply populate 3 textboxes ('FlitchNum' being the PK), click this button and the new record should be created.
However, when I run this I'm getting the error:
Column 'FlitchNum' does not allow nulls.
The error also shows that the following code, which is located in my dataset's .vb file, is causing the problem.
Line 425:
Line 426: Public Overloads Sub AddspLogsSelectRow(ByVal row As spLogsSelectRow)
Line 427: Me.Rows.Add(row)
Line 428: End Sub
Line 429:
Using a Breakpoint and a Watch I've verified that the textbox values are being passed correctly. The error occurs after they are passed.
Could someone please help me understand why this error is occuring? Thanks.
--
Mike
I'm programming a sub that adds a new record to a database. On my form I have an "Add" button with the below click handler.
The process is pretty straight forward - I simply populate 3 textboxes ('FlitchNum' being the PK), click this button and the new record should be created.
Code:
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Dim log As New LogsDP
Dim logrow As DsLogs.spLogsSelectRow
logrow = DsLogs1.spLogsSelect.NewRow
logrow.FlitchNum = Me.txtFlitchNum.Text
logrow.WhoOrdered = Me.txtWhoOrdered.Text
logrow.VendorName = Me.txtVendor.Text
log.AddLog(logrow)
Response.Redirect("Logs_List.aspx")
End Sub
However, when I run this I'm getting the error:
Column 'FlitchNum' does not allow nulls.
The error also shows that the following code, which is located in my dataset's .vb file, is causing the problem.
Line 425:
Line 426: Public Overloads Sub AddspLogsSelectRow(ByVal row As spLogsSelectRow)
Line 427: Me.Rows.Add(row)
Line 428: End Sub
Line 429:
Using a Breakpoint and a Watch I've verified that the textbox values are being passed correctly. The error occurs after they are passed.
Could someone please help me understand why this error is occuring? Thanks.
--
Mike