473,853 Members | 1,957 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 1718
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
1528
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
2159
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
1577
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
1041
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
3813
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
2776
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
1529
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
19241
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
9898
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9748
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11020
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...
1
10735
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9506
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
7907
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
5736
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...
1
4549
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4143
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.