insert failes

  • Thread starter Thread starter yoramo
  • Start date Start date
Y

yoramo

I'm tring to insert a new row to a table but it seems that it failes (I
think) because the values of the new Row are null.

here is the defenition of the table, I suspect that my problem is in the
defenition.

create table aa.dbo.Tasks
(
ID int primary key identity(1,1),
Done bit,
TaskGroup varchar(30),
Subject varchar(40),
Initiator int,
Resource int,
Note varchar(200)
)

Do I need to define default values?

Yoramo
 
oops I forget the alter table statement here it is:

alter table Tasks add constraint CnstResouce FOREIGN KEY (Initiator)
references Factors(ID) ;
 
Hi yoramo,

How are you trying to insert new row?
There is no need for default values as your columns are null allowed.
What does your error say?
 
I do not have any explanations but it start working.



I have removed all fields and updated the DataAdapter and then I added field
by field and test it surprisingly it worked.



Yoramo
 
Back
Top