473,769 Members | 3,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ReadOnlyExcepti on while trying to update a subquery column using TableAdapter

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
Jun 27 '08 #1
3 1713
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.

"Bogdan" <Bo****@company .comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
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


Jun 27 '08 #2
Thanks for the reply. Could you please explain what you meant by "issue
UPDATE command yourself..."?

Thanks,
Bogdan

"George Ter-Saakov" <gt****@cardone .comwrote in message
news:Ob******** ******@TK2MSFTN GP05.phx.gbl...
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.

"Bogdan" <Bo****@company .comwrote in message
news:%2******** ********@TK2MSF TNGP06.phx.gbl. ..
>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



Jun 27 '08 #3
I mean if you need to update record in the database just do something like
(psedocode)
con.Execute("UP DATE table SET field1 = 10 WHERE id=5")

Something like that....

George.
"Bogdan" <Bo****@company .comwrote in message
news:O6******** ******@TK2MSFTN GP02.phx.gbl...
Thanks for the reply. Could you please explain what you meant by "issue
UPDATE command yourself..."?

Thanks,
Bogdan

"George Ter-Saakov" <gt****@cardone .comwrote in message
news:Ob******** ******@TK2MSFTN GP05.phx.gbl...
>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.

"Bogdan" <Bo****@company .comwrote in message
news:%2******* *********@TK2MS FTNGP06.phx.gbl ...
>>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




Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
291
by: BStorm | last post by:
If I have a DataTable with a multipart primary key and want to update a column based upon a value for that key, what is the most efficient way to do this? For example, if I have an OrderDtl table with a primary key consisting of an OrderNo and OrderDtl and wish to update the OrderAmt colum when I have values for OrderNo and OrderDtl.
2
1524
by: Danny | last post by:
Is there any way to update a column in a clustered index without incurring the cost of reordering. Example: Create table TableX ( Col1 int, Col2 smalldatetime, Col3 varchar(10)) go create clustered indext ix_test on tableX (Col2, Col1)
5
2156
by: Chad | last post by:
Could any suggest to me a good way to programmatically identify which SPs update a database column. I would like to create a cross reference for our database.
2
1573
seshu
by: seshu | last post by:
Hi everybody This is seshu i have a piece of code to insert data into a column by taking the data from another table and the query is like this insert into table1 (table1.name) select table2.name from empdetails now aditonal to this i want update table 2 whase tdate value is null ie i wnat to update a column whose value is null i wrote this code update table2 set tdate='2007-01-17' where tdate='null'
0
1040
by: ManjushaA | last post by:
Hi, In sqlserver 2000 , do we have option to update column (value) which is related more than two tables. how to update a column by using 2 or 3 tables ? Thanks and Regards, Pratheeka.
7
3809
ak1dnar
by: ak1dnar | last post by:
There are two tables in my database 1. Table_A 2. Table_B Structure for Table_A A_ID - A_code(FK to B_ID) 1001 - Null 1002 - Null 1003 - Null
1
2772
by: abinesh.agarwal | last post by:
Hi , I want to update the column in a table based on the updation of the other column in the same table, but not getting the desired result. DDL: CREATE TABLE .( NULL,
0
1523
by: rote | last post by:
I have a project i created using TableAdapters(Datasets with .xsd) and everything works well on my PC. But when i create a websetup project and deploy it to another server. I keep getting Error ObjectDatasource cannot find a non generic update method Whats the best way to deploy projects when using DataSets like TableAdapters..
3
19235
by: fionashaw | last post by:
I am trying to fix an issue for a customer which requires us to update a column in a table with the value in the column concatenated (||) with the value in another row in the same table. The table holds comments on data items, where the data is held in datasets. Each year a new dataset is created by copying the previous years dataset but there is a problem where some of the comments were not copied and new comments have been added and they...
0
10210
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10043
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8869
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7406
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5446
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2814
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.