Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / April 2008

Tip: Looking for answers? Try searching our database.

ReadOnlyException while trying to update a subquery column using TableAdapter

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bogdan - 16 Apr 2008 19:53 GMT
Hi,

I've been struggling subqueries/joins and table adapters for some time and
can't find a clear answer.

I have a stored procedure that returns columns from 2 tables.  Two columns
from the second table are returned by subquery.  All this is done in a
stored procedure.

I also have a stored procedure that takes most of the params from the select
proc and updates both tables.

The problem is that columns from the second table (i.e. from a subquery)
seem to be read-only in the auto-generated table adapter.

I'm stuck and don't really know how to proceed.  It seems like an extremely
simple thing to do outside of asp.net.  Unfortunately I'm relatively new to
asp.net and not quite sure how to deal with it.

So, how do I pass parameters to the stored procedure that updates both
tables?

I'd appreciate _any_ suggestions.
Thanks,
Bogdan
George Ter-Saakov - 16 Apr 2008 20:02 GMT
As a general rule you should not be updating queries that are results of
Join operation...
Instead issue UPDATE command yourself...

Actually that is how it works behind the scene anyway.

George.

> Hi,
>
[quoted text clipped - 21 lines]
> Thanks,
> Bogdan
Bogdan - 16 Apr 2008 20:41 GMT
Thanks for the reply.  Could you please explain what you meant by "issue
UPDATE command yourself..."?

Thanks,
Bogdan

> As a general rule you should not be updating queries that are results of
> Join operation...
[quoted text clipped - 29 lines]
>> Thanks,
>> Bogdan
George Ter-Saakov - 16 Apr 2008 20:57 GMT
I mean if you need to update record in the database just do something like
(psedocode)
con.Execute("UPDATE table SET field1 = 10 WHERE id=5")

Something like that....

George.

> Thanks for the reply.  Could you please explain what you meant by "issue
> UPDATE command yourself..."?
[quoted text clipped - 35 lines]
>>> Thanks,
>>> Bogdan

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.