473,385 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 1453
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.