How to make sure a field is retrieved from a view
How to make sure a field is retrieved from a view
Hello
On the server we have a stored procedure for update like this
SELECT ID
INTO v_id
FROM am_kurvereg.kurvereg
WHERE
ID = pi_id
AND edit_date = pi_edit_date;
UPDATE am_kurvereg.kurvereg
SET strkafs = pi_strkafs
WHERE ID = pi_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN RAISE am_def.pkg_fejl.err_dirty;
This is the scheme we are using for Optimistic update.
The edit_date field is updated by a trigger.
In DotNet the first edit goes fine, but when I refresh the grid or call select again, the edit_date field is not retrieved.
Is there any way to make sure that a field is always retrieved - bypassing the cache ?
Best regards
Glenn
On the server we have a stored procedure for update like this
SELECT ID
INTO v_id
FROM am_kurvereg.kurvereg
WHERE
ID = pi_id
AND edit_date = pi_edit_date;
UPDATE am_kurvereg.kurvereg
SET strkafs = pi_strkafs
WHERE ID = pi_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN RAISE am_def.pkg_fejl.err_dirty;
This is the scheme we are using for Optimistic update.
The edit_date field is updated by a trigger.
In DotNet the first edit goes fine, but when I refresh the grid or call select again, the edit_date field is not retrieved.
Is there any way to make sure that a field is always retrieved - bypassing the cache ?
Best regards
Glenn
Hi!
In the DataContext file that is created from a view the only partial method that is predefined is OnCreated.
Further down there is a
private void UpdateVcompany(Vcompany obj)
{
this.Updatecompany((System.Nullable)obj.Companyid, obj.Companyname, (System.Nullable)obj.Primarycontact, obj.Web, obj.Email, obj.Addresstitle, obj.Address, obj.City, obj.Region, obj.Postalcode, obj.Country, obj.Phone, obj.Fax, (System.Nullable)obj.Editeddate);
}
So if I try to create one I get the following compile-time error:
"Type 'GnbaContext.GnbaDataContext' already defines a member called 'UpdateVcompany' with the same parameter types"
A work-around would be to inject some code in
private void UpdateVcompany(Vcompany obj)
to refresh the edited_date (and other fields) after the call to UpdateVCompany.
I just do not know what to write ?
Best regards
Glenn
In the DataContext file that is created from a view the only partial method that is predefined is OnCreated.
Further down there is a
private void UpdateVcompany(Vcompany obj)
{
this.Updatecompany((System.Nullable)obj.Companyid, obj.Companyname, (System.Nullable)obj.Primarycontact, obj.Web, obj.Email, obj.Addresstitle, obj.Address, obj.City, obj.Region, obj.Postalcode, obj.Country, obj.Phone, obj.Fax, (System.Nullable)obj.Editeddate);
}
So if I try to create one I get the following compile-time error:
"Type 'GnbaContext.GnbaDataContext' already defines a member called 'UpdateVcompany' with the same parameter types"
A work-around would be to inject some code in
private void UpdateVcompany(Vcompany obj)
to refresh the edited_date (and other fields) after the call to UpdateVCompany.
I just do not know what to write ?
Best regards
Glenn