473,770 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Simple 'NULL' / Databiding prob got me stumped..

Ok, I'm new at this and learning as I go, but under extreme pressure
from work.. So many bugs and little tricky obsticals have got me very
far behind, and this is the latest..

I made a simple databinding form, but not using the wizard, because it
doesn't use the SQL driver.

I'm keeping it simple right now with a very normal table with a
primary key 'SIN' (social insurance number). Well I'm following
along in the book to do the whole goto next record, delete etc.. All
works.. But the problem is ADDING a record. Whenever I try, it simply
says "column 'SIN' does not allow nulls". Well no $#1T. I have a
value in the field, but it simply erases it right away and gives me
that message. I've been searching for DAYS on this, and nobody has
seemed to have it figured out in this scenario. It seems to me like
an extremly common issue..So why all the headache? None of the books
examples seem to deal with this....

btw, I've tried:
setting a default value on the SQL table itself.
changing the xml schema to not allow nulls.
changing the xml schema to assign a default value.
Nov 21 '05 #1
1 1078
James,

When you add the row, do you than something like this
dim dr as datarow = table.newrow
dr("SIN") = x
and that should be done when it is not an autokey before the
table.add(dr)

In this case this construction does not work and gives errors
table.rows.add( table.newrow)

I think "cma.newrow " as well (I never tried it, because I do not take a
field like a Security number as primary key but let a seperated autokey as
primary key run). However the way I showed above should probably overcome
your problem.

I hope this helps?

Cor
Ok, I'm new at this and learning as I go, but under extreme pressure
from work.. So many bugs and little tricky obsticals have got me very
far behind, and this is the latest..

I made a simple databinding form, but not using the wizard, because it
doesn't use the SQL driver.

I'm keeping it simple right now with a very normal table with a
primary key 'SIN' (social insurance number). Well I'm following
along in the book to do the whole goto next record, delete etc.. All
works.. But the problem is ADDING a record. Whenever I try, it simply
says "column 'SIN' does not allow nulls". Well no $#1T. I have a
value in the field, but it simply erases it right away and gives me
that message. I've been searching for DAYS on this, and nobody has
seemed to have it figured out in this scenario. It seems to me like
an extremly common issue..So why all the headache? None of the books
examples seem to deal with this....

btw, I've tried:
setting a default value on the SQL table itself.
changing the xml schema to not allow nulls.
changing the xml schema to assign a default value.

Nov 21 '05 #2

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

Similar topics

5
4984
by: David Sobey | last post by:
Hi Sorry bout this basic prob. Got a file called file.obj. tryna read the first line from it as a string and print it to the screen. getting errors: #include "stdafx.h" #include <stdio.h> #include <fstream.h> #include <iostream.h> #include <string>
6
7300
by: Dishan Fernando | last post by:
Hi my prob is like this.. DECLARE @id int SELECT * FROM Table1 WHERE ID = @ID if @ID is null , I want to select all the records, that ID is null
5
1116
by: Daniel | last post by:
I want to do something really simple. I have a form and a class which handles my network layer The form has an instance of the network class as a member and initialises the network layer. Inside the network class it then starts dealing with connections and listening (server).
4
1525
by: Armand | last post by:
Hi Guys, I have a set of array that I would like to clear and empty out. Since I am using "Array" not "ArrayList", I have been struggling in finding the solution which is a simple prob for those who experience. (For some reason I have to implement Array not ArrayLists) Below are the simple following code: Dim Array() As String Dim intCounter As Integer
2
5339
by: PokerMan | last post by:
I have this object o = ds.Tables.Rows.ItemArray; the item read from my dataset is null. I check on the next line : if(o!= null) //then do something My prob is the object o is getting passed that if statement then i crash, in
0
1251
by: Greg Corradini | last post by:
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure if 'insert' or 'update' is the route I should be taking. CODE: #Import Pythond Standard Library Modules import win32com.client, sys, os, string, copy, glob import mx.ODBC.Windows as odbc
2
1730
by: harini | last post by:
i hv a datagrid to which i hv bound a table...i hv the table columns to be editable...i.e read only = false....now i hv a problem...in the table there seems to be a row at the end having no values automatically added...and it creates prob for me...i dont want that last null row to be present in the table...so how do i mk sure tat this last empty, null row dosent get attached to my table bound to the datagrid? p.s. if i mk my datagrid as read...
0
1444
by: Matt Michler | last post by:
I have a WebUserControl with a custom event, when this event is fired, the delegate or event object is throwing a null reference exception. The odd part of this is, it used to work flawlessly, now it never works. I'm not sure what change affected the event while my coworker and I were working on this control. Here's the event code in the control from which the event is spawned: <code> public Guid DbReferenceID { get {
5
1201
by: Kardon Coupé | last post by:
Dear All, I'm bemused, I'm moving an application I've written from VB6 into VS2005, and I'm getting all the fundamentals over before I delve into the hard part, like getting the forms layout etc....and the simple things, like the 'About' option, opens another form.... Well here is the problem (which has me stumped).... My VB6 Application, I click 'About' and it opens a form, from that form,
0
9618
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10101
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9906
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2850
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.