Hi,
My formview or gridview control stops updating or deleting a record
once the record has a null value.
I have table tblTest with the following
pkID int NOT NULL **IDENTITY COLUMN**
string1 varchar(30)
string2 varchar(30)
I then create a SqlDataSource with the statement:
Select * From [tblTest]
I have the insert, update and delete statements generated, and choose
optimistic concurrency. I add a couple records of dummy data.
I then drag a Formview control onto the page, and bind it to the
SqlDataSource I just created. I then fire it up in my browser, and I
can then update, insert and delete records. However, as soon as I
update a record with a null value, I can no longer update or delete
that record.
So, if I had a record in my FormView like:
string1: foo
string2: bar
I can update and delete normally. And when I update to:
string1: foo
string2:
the database correctly inserts a null value into string2. However, once
that null is in the record, I can't change anything about the record.
If I try to delete the record, the FormView will then display the
previous record, but I can still page to the record that should have
been deleted, and it still exists in the db. If I try to update the
record, the edits I make will not keep and the process will fail
silently.
What am I doing wrong? Should i be binding to a different object?
Regards,
Chris