"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
Go Back  Xtreme Visual Basic Talk > > > "Column "XXX" Does Not Allow Nulls"


Reply
 
Thread Tools Display Modes
  #1  
Old 04-15-2005, 01:24 AM
ms_junie ms_junie is offline
Newcomer
 
Join Date: Apr 2005
Posts: 1
Default "Column "XXX" Does Not Allow Nulls"


Hi,

This is my first post, and I am hoping someone could help me out (I am taking a visual basic .net class) . I am currently working on a simple form that uses an sql server. I have created two tables "tbl States & tbl Authors".

tbl States
- FirstZipCode
- LastZipCode
- StateCode
- State (Primary KEy)

tbl Authors
- AUthors
- ID ( Primary Key )
- Name
- Address
- City
- State
- ZipCOde
- Email

- When i test the UI, I am supposed to click an "ADD" button which clears out the fields under "tblauthors" so that i may enter new data and update.

My Problem
- all fields are text boxes except "Authors" (which is a combo box that directly connects to ID" when i click "ADD" and enter new data, itgives me an error and says that "Column "Authors" Does Not Allow Nulls". I have tried several things, such as allowing nulls under my database design. but still nothing seems to work.
- Also, when i load my forms, the email field ( which is supposed to allow nulls ) never seems to load onto the forms.


NOte: the updating works, until i click my "ADD" button which is supposed to clear the fields.

here is my code, if this would help:

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click
Me.ClearControls()
Me.SetMaintenanceButtons(False)
btnUpdateDB.Enabled = False
bNewRow = True
txtID.Focus()

End Sub

Private Sub ClearControls()
bLoading = True
cboAuthors.SelectedIndex = -1
txtID.Text = ""
txtName.Text = ""
txtAddress.Text = ""
txtCity.Text = ""
txtState.Text = ""
txtZipCode.Text = ""
txtPhone.Text = ""
txtEmail.Text = ""
bLoading = False

End Sub

Any help would be GREAT...

thanks!!!!!!!!!!!!!

ms_j

ps. this is my first time trying to ask for help on a forum, i did not know if would be better to post ALL my code or not, since its pretty lengthy
Reply With Quote
  #2  
Old 04-15-2005, 01:19 PM
MKoslof's Avatar
MKoslof"Column "XXX" Does Not Allow Nulls" MKoslof is offline
Cum Grano Salis

Retired Moderator
* Guru *
 
Join Date: Jul 2002
Location: Baltimore, Maryland
Posts: 14,636
Default

Welcome to the forum . Are you using DataBindings for your controls? can we see more of your relevant code? Where do you get this error..when attempting to send the information back to the database, or if you are using databindings, does the .Net application complain that one of the bound controls has a null value?
__________________
"Artificial Intelligence is no match for natural stupidity." ~unknown
Reply With Quote
  #3  
Old 04-20-2005, 09:11 AM
PeVe PeVe is offline
Newcomer
 
Join Date: Apr 2005
Posts: 4
Default

Hi there,

From what I understand from ur problem is the ur program will indeed try to add a new record to the authors table, but you didn't fill in a value for the ID. Trying to allow null values will only work once, because the ID is the primary key, and therefore must be unique. A better way is to set the datatype of the ID field to autonumber.

Hope this helps...
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls" "Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
 
"Column "XXX" Does Not Allow Nulls"
"Column "XXX" Does Not Allow Nulls"
 
-->