In GridView, DetailsView, or FormView, I always ran into a strange problem. In the
automatically generated DeleteCommand and UpdateCommand in asp:SqlDataSource
element, the WHERE clause always includes a string 'AND ? IS NULL', and I had to
manually edit it out.
The development is on Windows XP 5.1 SP 3, Microsoft Visual Studio 2005 SP2, ASP.NET 2.0.
The target database is on a Windows Server 2008 Standard, running SQL Server 2008.
I tried not using optimistic concurrency; now it does not have the error. However, that is because it does not compare with original values. How can I have both optimistic concurrency and correct syntax automatically generated correctly? If I don't specify
optimistic concurrency, what is the default behavior?
If I don't specify optimistic concurrency, what is the default behavior?
Hi,
If you don't specify optimistic concurrency,it will keep the current values and do to cope with the CRUD methods,this means you must have a unique key as a primary key for delete or update methods to tell the records from each other,otherwises you cannot
update or delete them.
chuang
0 Points
16 Posts
AND ? IS NULL
Dec 27, 2012 11:14 PM|LINK
Hi,
In GridView, DetailsView, or FormView, I always ran into a strange problem. In the
automatically generated DeleteCommand and UpdateCommand in asp:SqlDataSource
element, the WHERE clause always includes a string 'AND ? IS NULL', and I had to
manually edit it out.
The development is on Windows XP 5.1 SP 3, Microsoft Visual Studio 2005 SP2, ASP.NET 2.0.
The target database is on a Windows Server 2008 Standard, running SQL Server 2008.
Thanks
oned_gk
All-Star
30991 Points
6344 Posts
Re: AND ? IS NULL
Dec 27, 2012 11:53 PM|LINK
try dont use optimistic concurrency
chuang
0 Points
16 Posts
Re: AND ? IS NULL
Dec 28, 2012 03:45 PM|LINK
I tried not using optimistic concurrency; now it does not have the error. However, that is because it does not compare with original values. How can I have both optimistic concurrency and correct syntax automatically generated correctly? If I don't specify optimistic concurrency, what is the default behavior?
Decker Dong ...
All-Star
118619 Points
18779 Posts
Re: AND ? IS NULL
Dec 29, 2012 12:29 AM|LINK
Hi,
If you don't specify optimistic concurrency,it will keep the current values and do to cope with the CRUD methods,this means you must have a unique key as a primary key for delete or update methods to tell the records from each other,otherwises you cannot update or delete them.
Reguards!