473,473 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ASP.NET/VB.NET - Input is constantly recognized as NULL

Hello. I'm building a webform that allows users to add records to a
database. The code that adds the new record to the database is below.
Basically a user popualtes 3 textboxes on the webform and those values get
populated into specific columns of a new record.

The problem I'm having is that when I run this, I get an error stating that
the PK column does not allow nulls. Specifically the message says "Column
'FlitchNum' does not allow nulls". This message appears dispite the fact
that a value was entered into txtFlitchNum. The PK column is not an
auto-number column, a user must always input a value when creating a new
record. Could someone please help me understand what's going wrong? Thanks.
--------------------------------------------
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
--------------------------------------------
Jul 21 '05 #1
2 1456
CT
Hard to say what the problem is, but if you're correct when saying that
values are input to the three textboxes, the I suggest looking at the AddLog
method of the LogsDP class. That's one possibility...

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hello. I'm building a webform that allows users to add records to a
database. The code that adds the new record to the database is below.
Basically a user popualtes 3 textboxes on the webform and those values get
populated into specific columns of a new record.

The problem I'm having is that when I run this, I get an error stating
that
the PK column does not allow nulls. Specifically the message says
"Column
'FlitchNum' does not allow nulls". This message appears dispite the fact
that a value was entered into txtFlitchNum. The PK column is not an
auto-number column, a user must always input a value when creating a new
record. Could someone please help me understand what's going wrong?
Thanks.
--------------------------------------------
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
--------------------------------------------

Jul 21 '05 #2
try this:

logrow.FlitchNum = request("txtFlitchNum")
logrow.WhoOrdered = request("txtWhoOrdered")
logrow.VendorName = request("txtVendor")

hope this works..

"CT" wrote:
Hard to say what the problem is, but if you're correct when saying that
values are input to the three textboxes, the I suggest looking at the AddLog
method of the LogsDP class. That's one possibility...

--
Carsten Thomsen
Enterprise Development with VS .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"MrMike" <Mr****@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
Hello. I'm building a webform that allows users to add records to a
database. The code that adds the new record to the database is below.
Basically a user popualtes 3 textboxes on the webform and those values get
populated into specific columns of a new record.

The problem I'm having is that when I run this, I get an error stating
that
the PK column does not allow nulls. Specifically the message says
"Column
'FlitchNum' does not allow nulls". This message appears dispite the fact
that a value was entered into txtFlitchNum. The PK column is not an
auto-number column, a user must always input a value when creating a new
record. Could someone please help me understand what's going wrong?
Thanks.
--------------------------------------------
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
--------------------------------------------


Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rookie Card | last post by:
I know this is a very common issue but cannot find a thread that resolves the issue. I need to re-format my dates to "MMM d, yyyy". The problem I have is I have an MSSQL database that allows...
2
by: MrMike | last post by:
Hello. I'm building a webform that allows users to add records to a database. The code that adds the new record to the database is below. Basically a user popualtes 3 textboxes on the webform and...
10
by: dba123 | last post by:
Why am I getting this error for Budget? Error: An exception of type 'System.FormatException' occurred in mscorlib.dll but was not handled in user code Additional information: String was not...
2
by: phillip.s.powell | last post by:
For some bizarre reason, each time I insert or update a row in my table `image`, the field value for "image_width" is fixed at 127, no matter what value I use! Here is the schema: CREATE...
7
by: shocron | last post by:
problem: input values not recognized in dinamicly loaded IFRAMEs here is the thing I have a parent window that has an IFRAME I then load a diffrent page into the IFRAME that contains an input ...
0
by: Anonieko | last post by:
Are there any javascript codes there? Answer: Yes On the PageLoad event call InitialClientControsl as follows /// <summary> /// This will add client-side event handlers for most of the...
3
by: John Williams | last post by:
I'm writing a stagenography program to experiment with how it works. The algorithm I'm using appears to be producing the correct result...however I'm struggling with the file input. I never...
1
by: codferrow | last post by:
Hello, I have a small issue with a web-search engine I'm working on. The main table is constantly growing (1 insert per second, currently 150 000 records) and it has full-text indexes on 2 fields...
77
by: arnuld | last post by:
1st I think of creating an array of pointers of size 100 as this is the maximum input I intend to take. I can create a fixed size array but in the end I want my array to expand at run-time to fit...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.