Hello,
I have a gridview with 3 columns 2 of them constrained to be NoNullAllowed and one to be Primary Key.
I have written code in CellValidation and RowValidation to cancel the validation in some scenarios.
But there are situations in which the Exception for null or Primary key still occurs. i.e, After leaving a cell empty and clicking on header of a column. the situations are many and finally I turned off the constraints so the problem doesn't occur.
But after doing such an action, sometimes I encounter another problem: After making the cell empty and typing in it again Cell.Value or Cell.Text is null!
I strongly need an error-free powerful example of controlling null and dupplicate values.
PLEASE GUIDE ME.
Another question in my mind and is unsolved is that If i use SqlTransaction which encloses Update method of my adapter what will happen(suppose we have 3 added records)?
1. if update of record 2 fails then only record 2 is rolled back (record 1 is added).
2. Connection.Open and Close method executes for any INSERT Statement or once for all inserted records?
I want this one for all.
Thanks a lot, Tooraj Azizi.
I have a gridview with 3 columns 2 of them constrained to be NoNullAllowed and one to be Primary Key.
I have written code in CellValidation and RowValidation to cancel the validation in some scenarios.
But there are situations in which the Exception for null or Primary key still occurs. i.e, After leaving a cell empty and clicking on header of a column. the situations are many and finally I turned off the constraints so the problem doesn't occur.
But after doing such an action, sometimes I encounter another problem: After making the cell empty and typing in it again Cell.Value or Cell.Text is null!
I strongly need an error-free powerful example of controlling null and dupplicate values.
PLEASE GUIDE ME.
Another question in my mind and is unsolved is that If i use SqlTransaction which encloses Update method of my adapter what will happen(suppose we have 3 added records)?
1. if update of record 2 fails then only record 2 is rolled back (record 1 is added).
2. Connection.Open and Close method executes for any INSERT Statement or once for all inserted records?
I want this one for all.
Thanks a lot, Tooraj Azizi.