SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Update on an ADO Dataset that is linked to a view


Update on an ADO Dataset that is linked to a view

Author
Message
marmarhm2002
marmarhm2002
Forum Newbie
Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)Forum Newbie (7 reputation)

Group: General Forum Members
Points: 7 Visits: 29
Hi,

I have a table in my DB that has my Product information. this table has a tree structure (each record has a ParentId field to refer to its upper level record, it has 5 levels).
I have a view on this table. in this view I have joined my Product table to itself several times to have my product and its grouping information on higher level all in one row.
now I want to update row on the grid connected to my view (no Insert/Delete). I get this error:
"row cannot be located for updating. some values may have been changed since it was last read"
I think this is because SQL cant find the primary field in my view. I tried to use Instead Of Update trigger but
it seems the error occurs before the execution of the trigger. does anyone have any suggestion?
this is my view:
SELECT _Class.PartId AS ClassId,
_Class.ParentId AS ClassParentId,
_Class.PartCode AS ClassCode,
_Class.PartName AS ClassName,

_Group.PartId AS GroupId,
_Group.ParentId AS GroupParentId,
_Group.PartCode AS GroupCode,
_Group.PartName AS GroupName,

_Category.PartId AS CategoryId,
_Category.ParentId AS CategoryParentId,
_Category.PartCode AS CategoryCode,
_Category.PartName AS CategoryName,

_Part.PartId AS PartId,
_Part.ParentId AS PartParentId,
_Part.PartCode AS PartCode,
_Part.PartName AS PartName,

_Brand.PartId AS BrandId,
_Brand.ParentId AS BrandParentId,
_Brand.PartCode AS BrandCode,
_Brand.PartName AS BrandName,


_Brand.[P/N] AS [P/N],
_Brand.KindId AS KindId,
FROM prt_Part AS _Class INNER JOIN
prt_Part AS _Group ON _Class.PartId = _Group.ParentId INNER JOIN
prt_Part AS _Category ON _Group.PartId = _Category.ParentId INNER JOIN
prt_Part AS _Part ON _Category.PartId = _Part.ParentId INNER JOIN
prt_Part AS _Brand ON _Part.PartId = _Brand.ParentId
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search