473,434 Members | 1,372 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

advice on updating a calculated column (i.e. read-only) in datagrid


I have a non-updatable column in a SQL:-Server view that represents a 1-to
{0,1} relation with a child table.

I want the end-user to be able to change this value. This view is generated
with the following SQL code:

create view dbo.v_leads_person
AS
SELECT
p.personID,
p.companyID,
p.fname,
p.lname,
p.gender,
p.phone,
p.roleID,
CASE
WHEN mt.personID IS NULL THEN 'Not'
ELSE 'Yes'
END as mailTo
FROM person p LEFT JOIN mailTo mt ON p.personID = mt.personID
Ideally - the updating stored procedure that is called by the dataAdaptor
takes care of this with it's own custom code (written by me).

Currently the dataAdapter ignores any changes to the column and submits the
original back to the database.

Is there a way to over-ride this dataAdaptor behavior without resorting to
datagrid specific events?

Also...
Is there a 'best practice' regarding this scenario (design pattern?)? This
child table is used to enfore only one person being the 'mailTo' target for
a given company. There can be several contacts per company - but only one
can be designated as the 'mailTo'. There are other means of enforcing this
business rule - but having the business logic in the database is most
appealing to me from a design (and maintenance) perspective.

Thanks ).
Nov 23 '05 #1
0 941

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

Similar topics

1
by: Hari | last post by:
I have got a calculated column but i want to insert this column in the third column of the datagrid. How can i do that in C# C#? Thank you
0
by: Andrea Trevisan | last post by:
That's a revival of a known thing I suppose.I hope it's useful. My problem was: I want to have a DataGrid with two Template columns: first with TextBox,second with Button.I want to fire an event...
2
by: simon | last post by:
I have template column in dataGrid and visible=false. <asp:TemplateColumn visible=false> <ItemTemplate><asp:CheckBox Runat=server ID=chkExists Checked='<%# Container.DataItem( "obstaja" ) % ...
3
by: Kurt Schroeder | last post by:
can you populate a colmun in a data grid with a calculated value and can this be done on databind? I have a datagrid that is populated with a shopping cart. This data comes from the database. I...
8
by: Dan Keeley | last post by:
Hi, I have a dataset which is used to populate my datagrid something like this: My question is, how do I add a caluclated display column to the datagrid? It will be based on ScoreCardScore... ...
0
by: Manish | last post by:
Hey Guys I am using a datagrid to extract information out of SQL Server datbase. The fields extracted are category,week,budget,Last Year,Forecast and Projection. Also i add a calculated column...
3
by: chreo | last post by:
Hello. I have datagrid. I found code to select all row in data grid (by mouse or arrow keys). This works great - user can select row and... ....and I want to go to next control. For...
1
by: rcoco | last post by:
I'm trying to update one column in sql using data grid. I have two column one has a primary key. I want to update the one that does not have a primary key? But when I try to update one cell even...
1
by: Jason Huang | last post by:
Hi, In the code: DataGrid.HitTestInfo hti = dataGrid.HitTest( e.X, e.Y ); dataGrid = ! (bool) dataGrid; Would someone tell me what the line doing: DataGrid.HitTestInfo hti =...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...
0
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,...
0
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...
0
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...

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.